forked from OSchip/llvm-project
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:
parent
2f1aa118a4
commit
298d2f090f
|
@ -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));
|
||||||
|
|
||||||
|
|
|
@ -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));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue