1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

* Expose the verifier pass as one that can be ran

* Force the verifier to run before bytecode is written

llvm-svn: 1783
This commit is contained in:
Chris Lattner 2002-02-20 17:56:53 +00:00
parent 1b91bcee90
commit 3b17492321

View File

@ -11,6 +11,7 @@
#include "llvm/Bytecode/Reader.h"
#include "llvm/Bytecode/WriteBytecodePass.h"
#include "llvm/Assembly/PrintModulePass.h"
#include "llvm/Analysis/Verifier.h"
#include "llvm/Transforms/UnifyMethodExitNodes.h"
#include "llvm/Transforms/ConstantMerge.h"
#include "llvm/Transforms/CleanupGCCOutput.h"
@ -36,7 +37,10 @@ enum Opts {
dce, constprop, inlining, constmerge, strip, mstrip, mergereturn,
// Miscellaneous Transformations
trace, tracem, print, raiseallocs, cleangcc,
trace, tracem, raiseallocs, cleangcc,
// Printing and verifying...
print, verify,
// More powerful optimizations
indvars, instcombine, sccp, adce, raise, mem2reg,
@ -93,6 +97,7 @@ struct {
{ trace , New<InsertTraceCode, bool, true, bool, true> },
{ tracem , New<InsertTraceCode, bool, false, bool, true> },
{ print , NewPrintMethodPass },
{ verify , createVerifierPass },
{ raiseallocs, New<RaiseAllocations> },
{ cleangcc , New<CleanupGCCOutput> },
{ globaldce , New<GlobalDCE> },
@ -134,7 +139,9 @@ cl::EnumList<enum Opts> OptimizationList(cl::NoFlags,
clEnumVal(raise , "Raise to Higher Level"),
clEnumVal(trace , "Insert BB & Method trace code"),
clEnumVal(tracem , "Insert Method trace code only"),
clEnumVal(print , "Print working method to stderr"),
clEnumVal(verify , "Verify module is well formed"),
0);
@ -185,6 +192,9 @@ int main(int argc, char **argv) {
Passes.add(new PrintModulePass(&std::cerr));
}
// Check that the module is well formed on completion of optimization
Passes.add(createVerifierPass());
// Write bytecode out to disk or cout as the last step...
Passes.add(new WriteBytecodePass(Out, Out != &std::cout));