Push LLVMContext through GlobalVariables and IRBuilder.
[oota-llvm.git] / lib / Transforms / Utils / LowerInvoke.cpp
index 8a585d2283f6eee4b38ea66254aca9638c4d52ae..1eefdc4b3ca49d59764bb0ea26be0bf2a0df519a 100644 (file)
@@ -139,7 +139,8 @@ bool LowerInvoke::doInitialization(Module &M) {
     // Now that we've done that, insert the jmpbuf list head global, unless it
     // already exists.
     if (!(JBListHead = M.getGlobalVariable("llvm.sjljeh.jblist", PtrJBList))) {
-      JBListHead = new GlobalVariable(PtrJBList, false,
+      JBListHead = new GlobalVariable(M.getContext(),
+                                      PtrJBList, false,
                                       GlobalValue::LinkOnceAnyLinkage,
                                       Context->getNullValue(PtrJBList),
                                       "llvm.sjljeh.jblist", &M);
@@ -182,7 +183,8 @@ void LowerInvoke::createAbortMessage(Module *M) {
       Context->getConstantArray("ERROR: Exception thrown, but not caught!\n");
     AbortMessageLength = Msg->getNumOperands()-1;  // don't include \0
 
-    GlobalVariable *MsgGV = new GlobalVariable(Msg->getType(), true,
+    GlobalVariable *MsgGV = new GlobalVariable(M->getContext(),
+                                               Msg->getType(), true,
                                                GlobalValue::InternalLinkage,
                                                Msg, "abortmsg", M);
     std::vector<Constant*> GEPIdx(2, Context->getNullValue(Type::Int32Ty));
@@ -195,7 +197,8 @@ void LowerInvoke::createAbortMessage(Module *M) {
                         "Recompile program with -enable-correct-eh-support.\n");
     AbortMessageLength = Msg->getNumOperands()-1;  // don't include \0
 
-    GlobalVariable *MsgGV = new GlobalVariable(Msg->getType(), true,
+    GlobalVariable *MsgGV = new GlobalVariable(M->getContext(),
+                                               Msg->getType(), true,
                                                GlobalValue::InternalLinkage,
                                                Msg, "abortmsg", M);
     std::vector<Constant*> GEPIdx(2, Context->getNullValue(Type::Int32Ty));