diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-08 19:03:57 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-08 19:03:57 +0000 |
commit | b17f32945fa6dd8e552a16cc5273bba5805cf4e4 (patch) | |
tree | b8383165ab804187660d5c8eddb2dc7486730b93 /llvm/tools/bugpoint/Miscompilation.cpp | |
parent | d5ffa8ffb62df34c6fa3ba8ec4c29b2ea2891ad0 (diff) | |
download | bcm5719-llvm-b17f32945fa6dd8e552a16cc5273bba5805cf4e4.tar.gz bcm5719-llvm-b17f32945fa6dd8e552a16cc5273bba5805cf4e4.zip |
Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.
llvm-svn: 75025
Diffstat (limited to 'llvm/tools/bugpoint/Miscompilation.cpp')
-rw-r--r-- | llvm/tools/bugpoint/Miscompilation.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
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(); |