From 1ed219a9d2279ce5a5bbcf16d9b7ccc05cce638c Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 13 Oct 2010 01:36:30 +0000 Subject: Be more consistent in using ValueToValueMapTy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116387 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/BugDriver.h | 3 ++- tools/bugpoint/CrashDebugger.cpp | 8 ++++---- tools/bugpoint/ExtractFunction.cpp | 6 +++--- tools/bugpoint/Miscompilation.cpp | 12 ++++++------ 4 files changed, 15 insertions(+), 14 deletions(-) (limited to 'tools') diff --git a/tools/bugpoint/BugDriver.h b/tools/bugpoint/BugDriver.h index e48806a..cc78489 100644 --- a/tools/bugpoint/BugDriver.h +++ b/tools/bugpoint/BugDriver.h @@ -17,6 +17,7 @@ #define BUGDRIVER_H #include "llvm/ADT/ValueMap.h" +#include "llvm/Transforms/Utils/ValueMapper.h" #include #include @@ -322,7 +323,7 @@ void DeleteFunctionBody(Function *F); /// module, split the functions OUT of the specified module, and place them in /// the new module. Module *SplitFunctionsOutOfModule(Module *M, const std::vector &F, - ValueMap &VMap); + ValueToValueMapTy &VMap); } // End llvm namespace diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp index 57dc1c8..f19ef62 100644 --- a/tools/bugpoint/CrashDebugger.cpp +++ b/tools/bugpoint/CrashDebugger.cpp @@ -130,7 +130,7 @@ bool ReduceCrashingGlobalVariables::TestGlobalVariables( std::vector &GVs) { // Clone the program to try hacking it apart... - ValueMap VMap; + ValueToValueMapTy VMap; Module *M = CloneModule(BD.getProgram(), VMap); // Convert list to set for fast lookup... @@ -204,7 +204,7 @@ bool ReduceCrashingFunctions::TestFuncs(std::vector &Funcs) { return false; // Clone the program to try hacking it apart... - ValueMap VMap; + ValueToValueMapTy VMap; Module *M = CloneModule(BD.getProgram(), VMap); // Convert list to set for fast lookup... @@ -271,7 +271,7 @@ namespace { bool ReduceCrashingBlocks::TestBlocks(std::vector &BBs) { // Clone the program to try hacking it apart... - ValueMap VMap; + ValueToValueMapTy VMap; Module *M = CloneModule(BD.getProgram(), VMap); // Convert list to set for fast lookup... @@ -381,7 +381,7 @@ namespace { bool ReduceCrashingInstructions::TestInsts(std::vector &Insts) { // Clone the program to try hacking it apart... - ValueMap VMap; + ValueToValueMapTy VMap; Module *M = CloneModule(BD.getProgram(), VMap); // Convert list to set for fast lookup... diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp index b7d5f9f..4be16bc 100644 --- a/tools/bugpoint/ExtractFunction.cpp +++ b/tools/bugpoint/ExtractFunction.cpp @@ -193,7 +193,7 @@ static Constant *GetTorInit(std::vector > &TorList) { /// static ctors/dtors, we need to add an llvm.global_[cd]tors global to M2, and /// prune appropriate entries out of M1s list. static void SplitStaticCtorDtor(const char *GlobalName, Module *M1, Module *M2, - ValueMap &VMap) { + ValueToValueMapTy &VMap) { GlobalVariable *GV = M1->getNamedGlobal(GlobalName); if (!GV || GV->isDeclaration() || GV->hasLocalLinkage() || !GV->use_empty()) return; @@ -256,7 +256,7 @@ static void SplitStaticCtorDtor(const char *GlobalName, Module *M1, Module *M2, Module * llvm::SplitFunctionsOutOfModule(Module *M, const std::vector &F, - ValueMap &VMap) { + ValueToValueMapTy &VMap) { // Make sure functions & globals are all external so that linkage // between the two modules will work. for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) @@ -268,7 +268,7 @@ llvm::SplitFunctionsOutOfModule(Module *M, I->setLinkage(GlobalValue::ExternalLinkage); } - ValueMap NewVMap; + ValueToValueMapTy NewVMap; Module *New = CloneModule(M, NewVMap); // Make sure global initializers exist only in the safe module (CBE->.so) diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index 3f2b696..3a5f143 100644 --- a/tools/bugpoint/Miscompilation.cpp +++ b/tools/bugpoint/Miscompilation.cpp @@ -261,7 +261,7 @@ bool ReduceMiscompilingFunctions::TestFuncs(const std::vector &Funcs, // a function, we want to continue with the original function. Otherwise // we can conclude that a function triggers the bug when in fact one // needs a larger set of original functions to do so. - ValueMap VMap; + ValueToValueMapTy VMap; Module *Clone = CloneModule(BD.getProgram(), VMap); Module *Orig = BD.swapProgramIn(Clone); @@ -310,7 +310,7 @@ static bool ExtractLoops(BugDriver &BD, while (1) { if (BugpointIsInterrupted) return MadeChange; - ValueMap VMap; + ValueToValueMapTy VMap; Module *ToNotOptimize = CloneModule(BD.getProgram(), VMap); Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize, MiscompiledFunctions, @@ -476,7 +476,7 @@ bool ReduceMiscompiledBlocks::TestFuncs(const std::vector &BBs, outs() << '\n'; // Split the module into the two halves of the program we want. - ValueMap VMap; + ValueToValueMapTy VMap; Module *Clone = CloneModule(BD.getProgram(), VMap); Module *Orig = BD.swapProgramIn(Clone); std::vector FuncsOnClone; @@ -551,7 +551,7 @@ static bool ExtractBlocks(BugDriver &BD, return false; } - ValueMap VMap; + ValueToValueMapTy VMap; Module *ProgClone = CloneModule(BD.getProgram(), VMap); Module *ToExtract = SplitFunctionsOutOfModule(ProgClone, MiscompiledFunctions, @@ -738,7 +738,7 @@ void BugDriver::debugMiscompilation(std::string *Error) { // Output a bunch of bitcode files for the user... outs() << "Outputting reduced bitcode files which expose the problem:\n"; - ValueMap VMap; + ValueToValueMapTy VMap; Module *ToNotOptimize = CloneModule(getProgram(), VMap); Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize, MiscompiledFunctions, @@ -1011,7 +1011,7 @@ bool BugDriver::debugCodeGenerator(std::string *Error) { return true; // Split the module into the two halves of the program we want. - ValueMap VMap; + ValueToValueMapTy VMap; Module *ToNotCodeGen = CloneModule(getProgram(), VMap); Module *ToCodeGen = SplitFunctionsOutOfModule(ToNotCodeGen, Funcs, VMap); -- cgit v1.1