Make sure to verify the result before writing out the bytecode file. Not doing

so can cause obscure errors downstream.

llvm-svn: 10840
This commit is contained in:
Chris Lattner 2004-01-14 03:39:46 +00:00
parent 2f1aa118a4
commit 298d2f090f
2 changed files with 6 additions and 0 deletions

View File

@ -165,6 +165,9 @@ int main(int argc, char **argv) {
// //
AddConfiguredTransformationPasses(Passes); AddConfiguredTransformationPasses(Passes);
// Make sure everything is still good.
Passes.add(createVerifierPass());
// Write bytecode to file... // Write bytecode to file...
Passes.add(new WriteBytecodePass(Out)); Passes.add(new WriteBytecodePass(Out));

View File

@ -125,6 +125,9 @@ GenerateBytecode (Module *M, bool Strip, bool Internalize, std::ostream *Out) {
addPass(Passes, createGlobalDCEPass()); addPass(Passes, createGlobalDCEPass());
} }
// Make sure everything is still good.
Passes.add(createVerifierPass());
// Add the pass that writes bytecode to the output file... // Add the pass that writes bytecode to the output file...
addPass(Passes, new WriteBytecodePass(Out)); addPass(Passes, new WriteBytecodePass(Out));