Push LLVMContext through GlobalVariables and IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74985 91177308-0d34-0410-b5e6-96231b3b80d8
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 @@
// 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 @@
// 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