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 | e0f136d9637981bbc5096ca396e4df383c59eafe (patch) | |
tree | 04e35fb85689b9621ea6ec76db47849335a87c5c /tools | |
parent | b00d54ed680a35df08561e6e852b57a88c49c004 (diff) | |
download | external_llvm-e0f136d9637981bbc5096ca396e4df383c59eafe.zip external_llvm-e0f136d9637981bbc5096ca396e4df383c59eafe.tar.gz external_llvm-e0f136d9637981bbc5096ca396e4df383c59eafe.tar.bz2 |
Push LLVMContext through GlobalVariables and IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74985 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bugpoint/ExtractFunction.cpp | 6 | ||||
-rw-r--r-- | tools/bugpoint/Miscompilation.cpp | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp index e4affbb..84eb1e7 100644 --- a/tools/bugpoint/ExtractFunction.cpp +++ b/tools/bugpoint/ExtractFunction.cpp @@ -236,7 +236,8 @@ static void SplitStaticCtorDtor(const char *GlobalName, Module *M1, Module *M2, GV->eraseFromParent(); if (!M1Tors.empty()) { Constant *M1Init = GetTorInit(M1Tors); - new GlobalVariable(M1Init->getType(), false, GlobalValue::AppendingLinkage, + new GlobalVariable(M1->getContext(), M1Init->getType(), false, + GlobalValue::AppendingLinkage, M1Init, GlobalName, M1); } @@ -247,7 +248,8 @@ static void SplitStaticCtorDtor(const char *GlobalName, Module *M1, Module *M2, GV->eraseFromParent(); if (!M2Tors.empty()) { Constant *M2Init = GetTorInit(M2Tors); - new GlobalVariable(M2Init->getType(), false, GlobalValue::AppendingLinkage, + new GlobalVariable(M2->getContext(), M2Init->getType(), false, + GlobalValue::AppendingLinkage, M2Init, GlobalName, M2); } } diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index b3260e1..369f25a 100644 --- a/tools/bugpoint/Miscompilation.cpp +++ b/tools/bugpoint/Miscompilation.cpp @@ -703,7 +703,8 @@ static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test, // 1. Add a string constant with its name to the global file Constant *InitArray = ConstantArray::get(F->getName()); GlobalVariable *funcName = - new GlobalVariable(InitArray->getType(), true /*isConstant*/, + new GlobalVariable(Safe->getContext(), + InitArray->getType(), true /*isConstant*/, GlobalValue::InternalLinkage, InitArray, F->getName() + "_name", Safe); @@ -722,7 +723,8 @@ static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test, // Create a new global to hold the cached function pointer. Constant *NullPtr = ConstantPointerNull::get(F->getType()); GlobalVariable *Cache = - new GlobalVariable(F->getType(), false,GlobalValue::InternalLinkage, + new GlobalVariable(F->getParent()->getContext(), + F->getType(), false,GlobalValue::InternalLinkage, NullPtr,F->getName()+".fpcache", F->getParent()); // Construct a new stub function that will re-route calls to F |