Make sure to verify the result before writing out the bytecode file. Not doing
authorChris Lattner <sabre@nondot.org>
Wed, 14 Jan 2004 03:39:46 +0000 (03:39 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 14 Jan 2004 03:39:46 +0000 (03:39 +0000)
so can cause obscure errors downstream.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10840 91177308-0d34-0410-b5e6-96231b3b80d8

tools/gccas/gccas.cpp
tools/gccld/GenerateCode.cpp

index 356bc8216ad943b544fa5eba5e32c9f217a472ad..40053303db6480edf221b407efbd048f6acc24d0 100644 (file)
@@ -165,6 +165,9 @@ int main(int argc, char **argv) {
   //
   AddConfiguredTransformationPasses(Passes);
 
+  // Make sure everything is still good.
+  Passes.add(createVerifierPass());
+
   // Write bytecode to file...
   Passes.add(new WriteBytecodePass(Out));
 
index 6fd30c8d87e31123e537443cd08357c17cc45d96..d41a1f15f2484bfefb9b5a0cf3df0dc462c87cd1 100644 (file)
@@ -125,6 +125,9 @@ GenerateBytecode (Module *M, bool Strip, bool Internalize, std::ostream *Out) {
     addPass(Passes, createGlobalDCEPass());
   }
 
+  // Make sure everything is still good.
+  Passes.add(createVerifierPass());
+
   // Add the pass that writes bytecode to the output file...
   addPass(Passes, new WriteBytecodePass(Out));