diff options
| author | Owen Anderson <resistor@mac.com> | 2009-07-08 01:26:06 +0000 | 
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2009-07-08 01:26:06 +0000 | 
| commit | 5948fdf68b5a1a68e8dbc10d28ef77473d5fc774 (patch) | |
| tree | c7898711c9b1c034c981cd9d052a08ecc72f14dc /llvm/lib/Transforms/Utils | |
| parent | 5f21d2f69ab3cf891546f9f8eb13f5efa8653329 (diff) | |
| download | bcm5719-llvm-5948fdf68b5a1a68e8dbc10d28ef77473d5fc774.tar.gz bcm5719-llvm-5948fdf68b5a1a68e8dbc10d28ef77473d5fc774.zip  | |
Push LLVMContext through GlobalVariables and IRBuilder.
llvm-svn: 74985
Diffstat (limited to 'llvm/lib/Transforms/Utils')
| -rw-r--r-- | llvm/lib/Transforms/Utils/CloneModule.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/LowerInvoke.cpp | 9 | 
2 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneModule.cpp b/llvm/lib/Transforms/Utils/CloneModule.cpp index f6056364a7c..afebd5bd5d1 100644 --- a/llvm/lib/Transforms/Utils/CloneModule.cpp +++ b/llvm/lib/Transforms/Utils/CloneModule.cpp @@ -56,7 +56,8 @@ Module *llvm::CloneModule(const Module *M,    //    for (Module::const_global_iterator I = M->global_begin(), E = M->global_end();         I != E; ++I) { -    GlobalVariable *GV = new GlobalVariable(I->getType()->getElementType(), +    GlobalVariable *GV = new GlobalVariable(M->getContext(), +                                            I->getType()->getElementType(),                                              false,                                              GlobalValue::ExternalLinkage, 0,                                              I->getName(), New); diff --git a/llvm/lib/Transforms/Utils/LowerInvoke.cpp b/llvm/lib/Transforms/Utils/LowerInvoke.cpp index 8a585d2283f..1eefdc4b3ca 100644 --- a/llvm/lib/Transforms/Utils/LowerInvoke.cpp +++ b/llvm/lib/Transforms/Utils/LowerInvoke.cpp @@ -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));  | 

