@@ -55,6 +55,7 @@ ProjectIRDB::ProjectIRDB(IRDBOptions Options) : Options(Options) {
5555 MPM.addPass (ValueAnnotationPass ());
5656 // just to be sure that none of the passes messed up the module!
5757 MPM.addPass (llvm::VerifierPass ());
58+ ModulesToSlotTracker::updateMSTForModule (LLVMZeroValueMod.get ());
5859}
5960
6061ProjectIRDB::ProjectIRDB (const std::vector<std::string> &IRFiles,
@@ -105,6 +106,9 @@ ProjectIRDB::ProjectIRDB(const std::vector<llvm::Module *> &Modules,
105106}
106107
107108ProjectIRDB::~ProjectIRDB () {
109+ for (auto &[File, Module] : Modules) {
110+ ModulesToSlotTracker::deleteMSTForModule (Module.get ());
111+ }
108112 // release resources if IRDB does not own
109113 if (!(Options & IRDBOptions::OWNS)) {
110114 for (auto &Context : Contexts) {
@@ -134,6 +138,7 @@ void ProjectIRDB::preprocessModule(llvm::Module *M) {
134138 RetOrResInstructions.insert (RRInsts.begin (), RRInsts.end ());
135139 STOP_TIMER (" LLVM Passes" , PAMM_SEVERITY_LEVEL::Full);
136140 buildIDModuleMapping (M);
141+ ModulesToSlotTracker::updateMSTForModule (M);
137142}
138143
139144void ProjectIRDB::linkForWPA () {
@@ -199,6 +204,7 @@ void ProjectIRDB::linkForWPA() {
199204 // to link at all. But we have to update the WPAMOD pointer!
200205 WPAModule = Modules.begin ()->second .get ();
201206 }
207+ ModulesToSlotTracker::updateMSTForModule (WPAModule);
202208}
203209
204210void ProjectIRDB::preprocessAllModules () {
0 commit comments