From 30af36808263fc256ead4fc50b639420b016a58d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 13 Apr 2002 18:32:47 +0000 Subject: [PATCH] * Add the printm pass to allow dumping the entire module after a transformation. * s/Method/Function/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2234 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/opt/opt.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index c2c2620966b..f922dd82ccb 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -43,7 +43,7 @@ enum Opts { raiseallocs, funcresolve, cleangcc, lowerrefs, // Printing and verifying... - print, verify, + print, printm, verify, // More powerful optimizations indvars, instcombine, sccp, adce, raise, mem2reg, @@ -55,8 +55,12 @@ enum Opts { globaldce, swapstructs, sortstructs, poolalloc, }; -static Pass *createPrintMethodPass() { - return new PrintFunctionPass("Current Method: \n", &cerr); +static Pass *createPrintFunctionPass() { + return new PrintFunctionPass("Current Function: \n", &cerr); +} + +static Pass *createPrintModulePass() { + return new PrintModulePass(&cerr); } // OptTable - Correlate enum Opts to Pass constructors... @@ -86,7 +90,8 @@ struct { { tracem , createTraceValuesPassForMethod }, { paths , createProfilePathsPass }, - { print , createPrintMethodPass }, + { print , createPrintFunctionPass }, + { printm , createPrintModulePass }, { verify , createVerifierPass }, { raiseallocs, createRaiseAllocationsPass }, @@ -111,11 +116,11 @@ cl::EnumList OptimizationList(cl::NoFlags, clEnumVal(dce , "Dead Code Elimination"), clEnumVal(die , "Dead Instruction Elimination"), clEnumVal(constprop , "Simple constant propogation"), - clEnumValN(inlining , "inline", "Method integration"), + clEnumValN(inlining , "inline", "Function integration"), clEnumVal(constmerge , "Merge identical global constants"), clEnumVal(strip , "Strip symbols"), clEnumVal(mstrip , "Strip module symbols"), - clEnumVal(mergereturn, "Unify method exit nodes"), + clEnumVal(mergereturn, "Unify function exit nodes"), clEnumVal(indvars , "Simplify Induction Variables"), clEnumVal(instcombine, "Combine redundant instructions"), @@ -132,10 +137,11 @@ cl::EnumList OptimizationList(cl::NoFlags, clEnumVal(cleangcc , "Cleanup GCC Output"), clEnumVal(funcresolve, "Resolve calls to foo(...) to foo()"), clEnumVal(raise , "Raise to Higher Level"), - clEnumVal(trace , "Insert BB & Method trace code"), - clEnumVal(tracem , "Insert Method trace code only"), + clEnumVal(trace , "Insert BB and Function trace code"), + clEnumVal(tracem , "Insert Function trace code only"), clEnumVal(paths , "Insert path profiling instrumentation"), - clEnumVal(print , "Print working method to stderr"), + clEnumVal(print , "Print working function to stderr"), + clEnumVal(printm , "Print working module to stderr"), clEnumVal(verify , "Verify module is well formed"), clEnumVal(lowerrefs , "Decompose multi-dimensional structure/array refs to use one index per instruction"), 0);