mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-27 04:18:42 +00:00
Be more consistent in using ValueToValueMapTy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116387 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
1 parent
6932643a37
commit
1ed219a9d2
11 files changed
+44
-43
No files matched your search
@@ -17,6 +17,7 @@
|
||||
#define BUGDRIVER_H
|
||||
|
||||
#include "llvm/ADT/ValueMap.h"
|
||||
#include "llvm/Transforms/Utils/ValueMapper.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
@@ -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<Function*> &F,
|
||||
ValueMap<const Value*, Value*> &VMap);
|
||||
ValueToValueMapTy &VMap);
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ bool
|
||||
ReduceCrashingGlobalVariables::TestGlobalVariables(
|
||||
std::vector<GlobalVariable*> &GVs) {
|
||||
// Clone the program to try hacking it apart...
|
||||
ValueMap<const Value*, Value*> 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<Function*> &Funcs) {
|
||||
return false;
|
||||
|
||||
// Clone the program to try hacking it apart...
|
||||
ValueMap<const Value*, Value*> 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<const BasicBlock*> &BBs) {
|
||||
// Clone the program to try hacking it apart...
|
||||
ValueMap<const Value*, Value*> 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<const Instruction*>
|
||||
&Insts) {
|
||||
// Clone the program to try hacking it apart...
|
||||
ValueMap<const Value*, Value*> VMap;
|
||||
ValueToValueMapTy VMap;
|
||||
Module *M = CloneModule(BD.getProgram(), VMap);
|
||||
|
||||
// Convert list to set for fast lookup...
|
||||
|
||||
@@ -193,7 +193,7 @@ static Constant *GetTorInit(std::vector<std::pair<Function*, int> > &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<const Value*, Value*> &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<Function*> &F,
|
||||
ValueMap<const Value*, Value*> &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<const Value*, Value*> NewVMap;
|
||||
ValueToValueMapTy NewVMap;
|
||||
Module *New = CloneModule(M, NewVMap);
|
||||
|
||||
// Make sure global initializers exist only in the safe module (CBE->.so)
|
||||
|
||||
@@ -261,7 +261,7 @@ bool ReduceMiscompilingFunctions::TestFuncs(const std::vector<Function*> &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<const Value*, Value*> 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<const Value*, Value*> VMap;
|
||||
ValueToValueMapTy VMap;
|
||||
Module *ToNotOptimize = CloneModule(BD.getProgram(), VMap);
|
||||
Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize,
|
||||
MiscompiledFunctions,
|
||||
@@ -476,7 +476,7 @@ bool ReduceMiscompiledBlocks::TestFuncs(const std::vector<BasicBlock*> &BBs,
|
||||
outs() << '\n';
|
||||
|
||||
// Split the module into the two halves of the program we want.
|
||||
ValueMap<const Value*, Value*> VMap;
|
||||
ValueToValueMapTy VMap;
|
||||
Module *Clone = CloneModule(BD.getProgram(), VMap);
|
||||
Module *Orig = BD.swapProgramIn(Clone);
|
||||
std::vector<Function*> FuncsOnClone;
|
||||
@@ -551,7 +551,7 @@ static bool ExtractBlocks(BugDriver &BD,
|
||||
return false;
|
||||
}
|
||||
|
||||
ValueMap<const Value*, Value*> 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<const Value*, Value*> 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<const Value*, Value*> VMap;
|
||||
ValueToValueMapTy VMap;
|
||||
Module *ToNotCodeGen = CloneModule(getProgram(), VMap);
|
||||
Module *ToCodeGen = SplitFunctionsOutOfModule(ToNotCodeGen, Funcs, VMap);
|
||||
|
||||
|
||||
Reference in new issue
Block a user