16 if ((parent !=
nullptr) && (parent != inst)) {
17 parent->addNestedModule(inst);
22 llvm::errs() <<
"Multiple root module instances are not allowed\n";
37 LLVM_DEBUG(llvm::dbgs() <<
"Delete instances for " << inst->getName(););
40 LLVM_DEBUG(llvm::dbgs() <<
"- delete instance: " << inst->getInstanceName()
41 <<
", pointer: " << inst <<
"\n";);
64 inst->clearOnlyGlobal();
71 LLVM_DEBUG(llvm::dbgs() <<
"Done with delete\n";);
91 for (FindGlobalEvents::globalEventMapType::iterator it = eventMap.begin();
92 it != eventMap.end(); it++) {
93 std::string eventName = it->first;
103 auto test_module_it =
105 [instance_name](
const auto &instance) {
106 return (instance->getInstanceName() == instance_name);
110 return *test_module_it;
118 auto test_module_it =
120 [instance_decl](
const auto &instance) {
121 return (instance->getInstanceDecl() == instance_decl);
124 return *test_module_it;
145 os << inst->getInstanceName() <<
" ";
149 os <<
"Print out instance information";
std::map< std::string, clang::VarDecl * > globalEventMapType
map< string, string > simulationTimeMapType
ModuleInstance * getRootModuleInstance() const
void populateNestedModules()
ModuleInstance * root_module_inst_
map< EntryFunctionContainer *, FindGPUMacro::forStmtGPUMacroMapType > entryFunctionGPUMacroMapType
eventMapType getEventMapType()
std::pair< std::string, EventContainer * > eventPairType
FunctionDecl * scmain_function_decl_
entryFunctionGPUMacroMapType entry_function_gpu_macro_map_
void addGlobalEvents(FindGlobalEvents::globalEventMapType)
void addSimulationTime(FindSimTime::simulationTimeMapType)
std::map< std::string, EventContainer * > eventMapType
void addSCMain(FunctionDecl *)
entryFunctionGPUMacroMapType getEntryFunctionGPUMacroMap()
ModuleInstance * getInstance(const std::string &instance_name)
void addInstance(ModuleInstance *)
FindSimTime::simulationTimeMapType simulation_time_
std::vector< ModuleInstance * > & getInstances()
void addEntryFunctionGPUMacroMap(entryFunctionGPUMacroMapType)
unsigned int getNumEvents()
std::vector< ModuleInstance * > module_instances_