Flag -> Glue, the ongoing saga
[oota-llvm.git] / lib / VMCore / Module.cpp
index d7ddf96cb0700c3ae3764396beeddbf4da3790c1..341e527acb5b4150770ca2b59e6d223d9211cea1 100644 (file)
@@ -62,9 +62,11 @@ Module::Module(StringRef MID, LLVMContext& C)
   ValSymTab = new ValueSymbolTable();
   TypeSymTab = new TypeSymbolTable();
   NamedMDSymTab = new StringMap<NamedMDNode *>();
+  Context.addModule(this);
 }
 
 Module::~Module() {
+  Context.removeModule(this);
   dropAllReferences();
   GlobalList.clear();
   FunctionList.clear();