diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bugpoint/CrashDebugger.cpp | 3 | ||||
-rw-r--r-- | tools/bugpoint/ExtractFunction.cpp | 2 | ||||
-rw-r--r-- | tools/bugpoint/Miscompilation.cpp | 3 | ||||
-rw-r--r-- | tools/bugpoint/TestPasses.cpp | 2 | ||||
-rw-r--r-- | tools/lto/LTOModule.cpp | 2 |
5 files changed, 7 insertions, 5 deletions
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp index 9697b341f3..3084857f1a 100644 --- a/tools/bugpoint/CrashDebugger.cpp +++ b/tools/bugpoint/CrashDebugger.cpp @@ -299,7 +299,8 @@ bool ReduceCrashingBlocks::TestBlocks(std::vector<const BasicBlock*> &BBs) { if (isa<StructType>(BBTerm->getType())) BBTerm->replaceAllUsesWith(UndefValue::get(BBTerm->getType())); else if (BB->getTerminator()->getType() != Type::VoidTy) - BBTerm->replaceAllUsesWith(Constant::getNullValue(BBTerm->getType())); + BBTerm->replaceAllUsesWith( + BD.getContext().getNullValue(BBTerm->getType())); // Replace the old terminator instruction. BB->getInstList().pop_back(); diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp index 6cd2d19b4f..4498f98fe2 100644 --- a/tools/bugpoint/ExtractFunction.cpp +++ b/tools/bugpoint/ExtractFunction.cpp @@ -74,7 +74,7 @@ Module *BugDriver::deleteInstructionFromProgram(const Instruction *I, if (isa<StructType>(TheInst->getType())) TheInst->replaceAllUsesWith(UndefValue::get(TheInst->getType())); else if (TheInst->getType() != Type::VoidTy) - TheInst->replaceAllUsesWith(Constant::getNullValue(TheInst->getType())); + TheInst->replaceAllUsesWith(Context.getNullValue(TheInst->getType())); // Remove the instruction from the program. TheInst->getParent()->getInstList().erase(TheInst); diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index 785abb9240..5fffcc19db 100644 --- a/tools/bugpoint/Miscompilation.cpp +++ b/tools/bugpoint/Miscompilation.cpp @@ -711,7 +711,8 @@ static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test, // sbyte* so it matches the signature of the resolver function. // GetElementPtr *funcName, ulong 0, ulong 0 - std::vector<Constant*> GEPargs(2,Constant::getNullValue(Type::Int32Ty)); + std::vector<Constant*> GEPargs(2, + BD.getContext().getNullValue(Type::Int32Ty)); Value *GEP = ConstantExpr::getGetElementPtr(funcName, &GEPargs[0], 2); std::vector<Value*> ResolverArgs; ResolverArgs.push_back(GEP); diff --git a/tools/bugpoint/TestPasses.cpp b/tools/bugpoint/TestPasses.cpp index 900bf632a8..2c5b3b25ed 100644 --- a/tools/bugpoint/TestPasses.cpp +++ b/tools/bugpoint/TestPasses.cpp @@ -60,7 +60,7 @@ namespace { for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) if (CallInst *CI = dyn_cast<CallInst>(I)) { if (!CI->use_empty()) - CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); + CI->replaceAllUsesWith(Context->getNullValue(CI->getType())); CI->getParent()->getInstList().erase(CI); break; } diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp index c4980d6bf7..591547fb22 100644 --- a/tools/lto/LTOModule.cpp +++ b/tools/lto/LTOModule.cpp @@ -189,7 +189,7 @@ bool LTOModule::objcClassNameFromExpression(Constant* c, std::string& name) if (GlobalVariable* gvn = dyn_cast<GlobalVariable>(op)) { Constant* cn = gvn->getInitializer(); if (ConstantArray* ca = dyn_cast<ConstantArray>(cn)) { - if ( ca->isCString() ) { + if ( ca->isCString(getGlobalContext()) ) { name = ".objc_class_name_" + ca->getAsString(); return true; } |