[llvm-commits] CVS: llvm/tools/bugpoint/ExtractFunction.cpp

Chris Lattner lattner at cs.uiuc.edu
Sat Nov 22 22:52:01 PST 2003


Changes in directory llvm/tools/bugpoint:

ExtractFunction.cpp updated: 1.20 -> 1.21

---
Log message:

Do not DESTROY programs by default.  No wonder bugpoint was not being useful all this time!


---
Diffs of the changes:  (+7 -11)

Index: llvm/tools/bugpoint/ExtractFunction.cpp
diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.20 llvm/tools/bugpoint/ExtractFunction.cpp:1.21
--- llvm/tools/bugpoint/ExtractFunction.cpp:1.20	Tue Nov 11 16:41:34 2003
+++ llvm/tools/bugpoint/ExtractFunction.cpp	Sat Nov 22 22:51:05 2003
@@ -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 @@
          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 @@
   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 @@
   }
   return M;
 }
-
-} // End llvm namespace





More information about the llvm-commits mailing list