Make sure to verify the result before writing out the bytecode file. Not doing
so can cause obscure errors downstream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10840 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/gccas/gccas.cpp b/tools/gccas/gccas.cpp
index 356bc82..4005330 100644
--- a/tools/gccas/gccas.cpp
+++ b/tools/gccas/gccas.cpp
@@ -165,6 +165,9 @@
//
AddConfiguredTransformationPasses(Passes);
+ // Make sure everything is still good.
+ Passes.add(createVerifierPass());
+
// Write bytecode to file...
Passes.add(new WriteBytecodePass(Out));
diff --git a/tools/gccld/GenerateCode.cpp b/tools/gccld/GenerateCode.cpp
index 6fd30c8..d41a1f1 100644
--- a/tools/gccld/GenerateCode.cpp
+++ b/tools/gccld/GenerateCode.cpp
@@ -125,6 +125,9 @@
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));