summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/ExtractFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-23 04:51:05 +0000
committerChris Lattner <sabre@nondot.org>2003-11-23 04:51:05 +0000
commit3f1ad878aca39e4756d81eab67065a44885cc2ff (patch)
treeee6e91826ef8f262f818b953fd39eecbb075613c /llvm/tools/bugpoint/ExtractFunction.cpp
parentedb102c266d073a7a41e119612bea2b53ee1b934 (diff)
downloadbcm5719-llvm-3f1ad878aca39e4756d81eab67065a44885cc2ff.tar.gz
bcm5719-llvm-3f1ad878aca39e4756d81eab67065a44885cc2ff.zip
Do not DESTROY programs by default. No wonder bugpoint was not being useful all this time!
llvm-svn: 10175
Diffstat (limited to 'llvm/tools/bugpoint/ExtractFunction.cpp')
-rw-r--r--llvm/tools/bugpoint/ExtractFunction.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/llvm/tools/bugpoint/ExtractFunction.cpp b/llvm/tools/bugpoint/ExtractFunction.cpp
index 4c671be62fa..0a56ceb35d2 100644
--- a/llvm/tools/bugpoint/ExtractFunction.cpp
+++ b/llvm/tools/bugpoint/ExtractFunction.cpp
@@ -24,16 +24,12 @@
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Target/TargetData.h"
#include "Support/CommandLine.h"
-
+using namespace llvm;
namespace llvm {
-
-bool DisableSimplifyCFG = false;
-
+ bool DisableSimplifyCFG = false;
} // End llvm namespace
-using namespace llvm;
-
namespace {
cl::opt<bool>
NoADCE("disable-adce",
@@ -46,8 +42,6 @@ namespace {
cl::desc("Do not use the -simplifycfg pass to reduce testcases"));
}
-namespace llvm {
-
/// deleteInstructionFromProgram - This method clones the current Program and
/// deletes the specified instruction from the cloned module. It then runs a
/// series of cleanup passes (ADCE and SimplifyCFG) to eliminate any code which
@@ -114,8 +108,12 @@ Module *BugDriver::performFinalCleanups(Module *M, bool MayModifySemantics) {
CleanupPasses.push_back(getPI(createFunctionResolvingPass()));
CleanupPasses.push_back(getPI(createGlobalDCEPass()));
CleanupPasses.push_back(getPI(createDeadTypeEliminationPass()));
- CleanupPasses.push_back(getPI(createDeadArgHackingPass()));
+ if (MayModifySemantics)
+ CleanupPasses.push_back(getPI(createDeadArgHackingPass()));
+ else
+ CleanupPasses.push_back(getPI(createDeadArgEliminationPass()));
+
std::swap(Program, M);
std::string Filename;
bool Failed = runPasses(CleanupPasses, Filename);
@@ -134,5 +132,3 @@ Module *BugDriver::performFinalCleanups(Module *M, bool MayModifySemantics) {
}
return M;
}
-
-} // End llvm namespace
OpenPOWER on IntegriCloud