diff options
author | Abdalrhman Mohamed <32971963+abdoo8080@users.noreply.github.com> | 2020-09-02 11:50:41 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-02 11:50:41 -0500 |
commit | dd912a03113bbc5ad93260babba061362b660acd (patch) | |
tree | a674b912b0bbd178b46b51f09abe5cf7d1c13c6a /src/smt/dump_manager.cpp | |
parent | 95bba975fd13261ca8854d9fb30d03fc7447eb80 (diff) |
Introduce an internal version of Commands. (#4988)
This PR is a step towards the migration of Commands to the public API. Node versions of some Commands are introduced for internal use (as necessary). The DumpManager is refactored to make use of those commands.
Diffstat (limited to 'src/smt/dump_manager.cpp')
-rw-r--r-- | src/smt/dump_manager.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/smt/dump_manager.cpp b/src/smt/dump_manager.cpp index d5fd65c4c..033be405f 100644 --- a/src/smt/dump_manager.cpp +++ b/src/smt/dump_manager.cpp @@ -51,7 +51,7 @@ void DumpManager::finishInit() void DumpManager::resetAssertions() { d_modelGlobalCommands.clear(); } -void DumpManager::addToModelCommandAndDump(const Command& c, +void DumpManager::addToModelCommandAndDump(const NodeCommand& c, uint32_t flags, bool userVisible, const char* dumpTag) @@ -70,14 +70,14 @@ void DumpManager::addToModelCommandAndDump(const Command& c, { if (flags & ExprManager::VAR_FLAG_GLOBAL) { - d_modelGlobalCommands.push_back(std::unique_ptr<Command>(c.clone())); + d_modelGlobalCommands.push_back(std::unique_ptr<NodeCommand>(c.clone())); } else { - Command* cc = c.clone(); + NodeCommand* cc = c.clone(); d_modelCommands.push_back(cc); // also remember for memory management purposes - d_modelCommandsAlloc.push_back(std::unique_ptr<Command>(cc)); + d_modelCommandsAlloc.push_back(std::unique_ptr<NodeCommand>(cc)); } } if (Dump.isOn(dumpTag)) @@ -88,7 +88,7 @@ void DumpManager::addToModelCommandAndDump(const Command& c, } else { - d_dumpCommands.push_back(std::unique_ptr<Command>(c.clone())); + d_dumpCommands.push_back(std::unique_ptr<NodeCommand>(c.clone())); } } } @@ -96,7 +96,7 @@ void DumpManager::addToModelCommandAndDump(const Command& c, void DumpManager::setPrintFuncInModel(Node f, bool p) { Trace("setp-model") << "Set printInModel " << f << " to " << p << std::endl; - for (std::unique_ptr<Command>& c : d_modelGlobalCommands) + for (std::unique_ptr<NodeCommand>& c : d_modelGlobalCommands) { DeclareFunctionCommand* dfc = dynamic_cast<DeclareFunctionCommand*>(c.get()); @@ -109,7 +109,7 @@ void DumpManager::setPrintFuncInModel(Node f, bool p) } } } - for (Command* c : d_modelCommands) + for (NodeCommand* c : d_modelCommands) { DeclareFunctionCommand* dfc = dynamic_cast<DeclareFunctionCommand*>(c); if (dfc != NULL) @@ -128,7 +128,7 @@ size_t DumpManager::getNumModelCommands() const return d_modelCommands.size() + d_modelGlobalCommands.size(); } -const Command* DumpManager::getModelCommand(size_t i) const +const NodeCommand* DumpManager::getModelCommand(size_t i) const { Assert(i < getNumModelCommands()); // index the global commands first, then the locals |