mirror of
https://github.com/YosysHQ/yosys
synced 2025-07-24 05:08:56 +00:00
Use C++11 final/override keywords.
This commit is contained in:
parent
dfde1cf1c5
commit
7191dd16f9
220 changed files with 540 additions and 548 deletions
|
@ -38,7 +38,7 @@ struct FwdCellEdgesDatabase : AbstractCellEdgesDatabase
|
|||
dict<SigBit, pool<SigBit>> db;
|
||||
FwdCellEdgesDatabase(SigMap &sigmap) : sigmap(sigmap) { }
|
||||
|
||||
void add_edge(RTLIL::Cell *cell, RTLIL::IdString from_port, int from_bit, RTLIL::IdString to_port, int to_bit, int) YS_OVERRIDE {
|
||||
void add_edge(RTLIL::Cell *cell, RTLIL::IdString from_port, int from_bit, RTLIL::IdString to_port, int to_bit, int) override {
|
||||
SigBit from_sigbit = sigmap(cell->getPort(from_port)[from_bit]);
|
||||
SigBit to_sigbit = sigmap(cell->getPort(to_port)[to_bit]);
|
||||
db[from_sigbit].insert(to_sigbit);
|
||||
|
@ -51,7 +51,7 @@ struct RevCellEdgesDatabase : AbstractCellEdgesDatabase
|
|||
dict<SigBit, pool<SigBit>> db;
|
||||
RevCellEdgesDatabase(SigMap &sigmap) : sigmap(sigmap) { }
|
||||
|
||||
void add_edge(RTLIL::Cell *cell, RTLIL::IdString from_port, int from_bit, RTLIL::IdString to_port, int to_bit, int) YS_OVERRIDE {
|
||||
void add_edge(RTLIL::Cell *cell, RTLIL::IdString from_port, int from_bit, RTLIL::IdString to_port, int to_bit, int) override {
|
||||
SigBit from_sigbit = sigmap(cell->getPort(from_port)[from_bit]);
|
||||
SigBit to_sigbit = sigmap(cell->getPort(to_port)[to_bit]);
|
||||
db[to_sigbit].insert(from_sigbit);
|
||||
|
|
|
@ -158,7 +158,7 @@ struct ModIndex : public RTLIL::Monitor
|
|||
#endif
|
||||
}
|
||||
|
||||
void notify_connect(RTLIL::Cell *cell, const RTLIL::IdString &port, const RTLIL::SigSpec &old_sig, const RTLIL::SigSpec &sig) YS_OVERRIDE
|
||||
void notify_connect(RTLIL::Cell *cell, const RTLIL::IdString &port, const RTLIL::SigSpec &old_sig, const RTLIL::SigSpec &sig) override
|
||||
{
|
||||
log_assert(module == cell->module);
|
||||
|
||||
|
@ -169,7 +169,7 @@ struct ModIndex : public RTLIL::Monitor
|
|||
port_add(cell, port, sig);
|
||||
}
|
||||
|
||||
void notify_connect(RTLIL::Module *mod YS_ATTRIBUTE(unused), const RTLIL::SigSig &sigsig) YS_OVERRIDE
|
||||
void notify_connect(RTLIL::Module *mod YS_ATTRIBUTE(unused), const RTLIL::SigSig &sigsig) override
|
||||
{
|
||||
log_assert(module == mod);
|
||||
|
||||
|
@ -214,13 +214,13 @@ struct ModIndex : public RTLIL::Monitor
|
|||
}
|
||||
}
|
||||
|
||||
void notify_connect(RTLIL::Module *mod YS_ATTRIBUTE(unused), const std::vector<RTLIL::SigSig>&) YS_OVERRIDE
|
||||
void notify_connect(RTLIL::Module *mod YS_ATTRIBUTE(unused), const std::vector<RTLIL::SigSig>&) override
|
||||
{
|
||||
log_assert(module == mod);
|
||||
auto_reload_module = true;
|
||||
}
|
||||
|
||||
void notify_blackout(RTLIL::Module *mod YS_ATTRIBUTE(unused)) YS_OVERRIDE
|
||||
void notify_blackout(RTLIL::Module *mod YS_ATTRIBUTE(unused)) override
|
||||
{
|
||||
log_assert(module == mod);
|
||||
auto_reload_module = true;
|
||||
|
|
|
@ -753,7 +753,7 @@ static struct CellHelpMessages {
|
|||
|
||||
struct HelpPass : public Pass {
|
||||
HelpPass() : Pass("help", "display help messages") { }
|
||||
void help() YS_OVERRIDE
|
||||
void help() override
|
||||
{
|
||||
log("\n");
|
||||
log(" help ................ list all commands\n");
|
||||
|
@ -822,7 +822,7 @@ struct HelpPass : public Pass {
|
|||
|
||||
fclose(f);
|
||||
}
|
||||
void execute(std::vector<std::string> args, RTLIL::Design*) YS_OVERRIDE
|
||||
void execute(std::vector<std::string> args, RTLIL::Design*) override
|
||||
{
|
||||
if (args.size() == 1) {
|
||||
log("\n");
|
||||
|
@ -926,7 +926,7 @@ struct HelpPass : public Pass {
|
|||
|
||||
struct EchoPass : public Pass {
|
||||
EchoPass() : Pass("echo", "turning echoing back of commands on and off") { }
|
||||
void help() YS_OVERRIDE
|
||||
void help() override
|
||||
{
|
||||
log("\n");
|
||||
log(" echo on\n");
|
||||
|
@ -939,7 +939,7 @@ struct EchoPass : public Pass {
|
|||
log("Do not print all commands to log before executing them. (default)\n");
|
||||
log("\n");
|
||||
}
|
||||
void execute(std::vector<std::string> args, RTLIL::Design*) YS_OVERRIDE
|
||||
void execute(std::vector<std::string> args, RTLIL::Design*) override
|
||||
{
|
||||
if (args.size() > 2)
|
||||
cmd_error(args, 2, "Unexpected argument.");
|
||||
|
@ -964,7 +964,7 @@ struct MinisatSatSolver : public SatSolver {
|
|||
MinisatSatSolver() : SatSolver("minisat") {
|
||||
yosys_satsolver = this;
|
||||
}
|
||||
ezSAT *create() YS_OVERRIDE {
|
||||
ezSAT *create() override {
|
||||
return new ezMiniSAT();
|
||||
}
|
||||
} MinisatSatSolver;
|
||||
|
|
|
@ -97,9 +97,9 @@ struct Frontend : Pass
|
|||
|
||||
std::string frontend_name;
|
||||
Frontend(std::string name, std::string short_help = "** document me **");
|
||||
void run_register() YS_OVERRIDE;
|
||||
~Frontend() YS_OVERRIDE;
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE YS_FINAL;
|
||||
void run_register() override;
|
||||
~Frontend() override;
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *design) override final;
|
||||
virtual void execute(std::istream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design) = 0;
|
||||
|
||||
static std::vector<std::string> next_args;
|
||||
|
@ -113,9 +113,9 @@ struct Backend : Pass
|
|||
{
|
||||
std::string backend_name;
|
||||
Backend(std::string name, std::string short_help = "** document me **");
|
||||
void run_register() YS_OVERRIDE;
|
||||
~Backend() YS_OVERRIDE;
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE YS_FINAL;
|
||||
void run_register() override;
|
||||
~Backend() override;
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *design) override final;
|
||||
virtual void execute(std::ostream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design) = 0;
|
||||
|
||||
void extra_args(std::ostream *&f, std::string &filename, std::vector<std::string> args, size_t argidx, bool bin_output = false);
|
||||
|
|
|
@ -713,7 +713,7 @@ extern Tcl_Interp *yosys_get_tcl_interp()
|
|||
|
||||
struct TclPass : public Pass {
|
||||
TclPass() : Pass("tcl", "execute a TCL script file") { }
|
||||
void help() YS_OVERRIDE {
|
||||
void help() override {
|
||||
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
|
||||
log("\n");
|
||||
log(" tcl <filename> [args]\n");
|
||||
|
@ -730,7 +730,7 @@ struct TclPass : public Pass {
|
|||
log("the standard $argc and $argv variables.\n");
|
||||
log("\n");
|
||||
}
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *) YS_OVERRIDE {
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *) override {
|
||||
if (args.size() < 2)
|
||||
log_cmd_error("Missing script file.\n");
|
||||
|
||||
|
@ -1220,7 +1220,7 @@ void shell(RTLIL::Design *design)
|
|||
|
||||
struct ShellPass : public Pass {
|
||||
ShellPass() : Pass("shell", "enter interactive command mode") { }
|
||||
void help() YS_OVERRIDE {
|
||||
void help() override {
|
||||
log("\n");
|
||||
log(" shell\n");
|
||||
log("\n");
|
||||
|
@ -1252,7 +1252,7 @@ struct ShellPass : public Pass {
|
|||
log("Press Ctrl-D or type 'exit' to leave the interactive shell.\n");
|
||||
log("\n");
|
||||
}
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE {
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *design) override {
|
||||
extra_args(args, 1, design, false);
|
||||
shell(design);
|
||||
}
|
||||
|
@ -1261,7 +1261,7 @@ struct ShellPass : public Pass {
|
|||
#if defined(YOSYS_ENABLE_READLINE) || defined(YOSYS_ENABLE_EDITLINE)
|
||||
struct HistoryPass : public Pass {
|
||||
HistoryPass() : Pass("history", "show last interactive commands") { }
|
||||
void help() YS_OVERRIDE {
|
||||
void help() override {
|
||||
log("\n");
|
||||
log(" history\n");
|
||||
log("\n");
|
||||
|
@ -1270,7 +1270,7 @@ struct HistoryPass : public Pass {
|
|||
log("from executed scripts.\n");
|
||||
log("\n");
|
||||
}
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE {
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *design) override {
|
||||
extra_args(args, 1, design, false);
|
||||
#ifdef YOSYS_ENABLE_READLINE
|
||||
for(HIST_ENTRY **list = history_list(); *list != NULL; list++)
|
||||
|
@ -1285,7 +1285,7 @@ struct HistoryPass : public Pass {
|
|||
|
||||
struct ScriptCmdPass : public Pass {
|
||||
ScriptCmdPass() : Pass("script", "execute commands from file or wire") { }
|
||||
void help() YS_OVERRIDE {
|
||||
void help() override {
|
||||
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
|
||||
log("\n");
|
||||
log(" script <filename> [<from_label>:<to_label>]\n");
|
||||
|
@ -1308,7 +1308,7 @@ struct ScriptCmdPass : public Pass {
|
|||
log("'-module' mode can be exited by using the 'cd' command.\n");
|
||||
log("\n");
|
||||
}
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *design) override
|
||||
{
|
||||
bool scriptwire = false;
|
||||
|
||||
|
|
|
@ -136,14 +136,6 @@ extern Tcl_Obj *Tcl_ObjSetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *p
|
|||
#define YOSYS_NAMESPACE_PREFIX Yosys::
|
||||
#define USING_YOSYS_NAMESPACE using namespace Yosys;
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
# define YS_OVERRIDE override
|
||||
# define YS_FINAL final
|
||||
#else
|
||||
# define YS_OVERRIDE
|
||||
# define YS_FINAL
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
# define YS_ATTRIBUTE(...) __attribute__((__VA_ARGS__))
|
||||
# define YS_NORETURN
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue