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

Chris Lattner lattner at cs.uiuc.edu
Fri Aug 1 11:15:01 PDT 2003


Changes in directory llvm/tools/bugpoint:

CodeGeneratorBug.cpp updated: 1.7 -> 1.8

---
Log message:

Don't emit modules with lots of cruft hanging off of them.


---
Diffs of the changes:

Index: llvm/tools/bugpoint/CodeGeneratorBug.cpp
diff -u llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.7 llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.8
--- llvm/tools/bugpoint/CodeGeneratorBug.cpp:1.7	Wed Jul 30 16:45:20 2003
+++ llvm/tools/bugpoint/CodeGeneratorBug.cpp	Fri Aug  1 11:14:33 2003
@@ -167,6 +167,15 @@
     }
   }
 
+  if (verifyModule(*SafeModule) || verifyModule(*TestModule)) {
+    std::cerr << "Bugpoint has a bug, an corrupted a module!!\n";
+    abort();
+  }
+
+  // Clean up the modules, removing extra cruft that we don't need anymore...
+  SafeModule = BD.performFinalCleanups(SafeModule);
+  TestModule = BD.performFinalCleanups(TestModule);
+
   DEBUG(std::cerr << "Safe module:\n";
         typedef Module::iterator MI;
         typedef Module::giterator MGI;
@@ -185,10 +194,7 @@
 
   // Write out the bytecode to be sent to CBE
   std::string SafeModuleBC = getUniqueFilename("bugpoint.safe.bc");
-  if (verifyModule(*SafeModule)) {
-    std::cerr << "Bytecode file corrupted!\n";
-    exit(1);
-  }
+
   if (BD.writeProgramToFile(SafeModuleBC, SafeModule)) {
     std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting.";
     exit(1);





More information about the llvm-commits mailing list