From b17f32945fa6dd8e552a16cc5273bba5805cf4e4 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Wed, 8 Jul 2009 19:03:57 +0000 Subject: Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required. llvm-svn: 75025 --- llvm/tools/bugpoint/Miscompilation.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'llvm/tools/bugpoint/Miscompilation.cpp') diff --git a/llvm/tools/bugpoint/Miscompilation.cpp b/llvm/tools/bugpoint/Miscompilation.cpp index 369f25a5161..a24ea777811 100644 --- a/llvm/tools/bugpoint/Miscompilation.cpp +++ b/llvm/tools/bugpoint/Miscompilation.cpp @@ -703,10 +703,9 @@ 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(Safe->getContext(), - InitArray->getType(), true /*isConstant*/, + new GlobalVariable(*Safe, InitArray->getType(), true /*isConstant*/, GlobalValue::InternalLinkage, InitArray, - F->getName() + "_name", Safe); + F->getName() + "_name"); // 2. Use `GetElementPtr *funcName, 0, 0' to convert the string to an // sbyte* so it matches the signature of the resolver function. @@ -723,9 +722,9 @@ 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->getParent()->getContext(), - F->getType(), false,GlobalValue::InternalLinkage, - NullPtr,F->getName()+".fpcache", F->getParent()); + new GlobalVariable(*F->getParent(), F->getType(), + false, GlobalValue::InternalLinkage, + NullPtr,F->getName()+".fpcache"); // Construct a new stub function that will re-route calls to F const FunctionType *FuncTy = F->getFunctionType(); -- cgit v1.2.3