Mercurial > projects > ldc
diff gen/cl_options.cpp @ 1170:e40c65bd8c5d
Allow specific optimization passes to be requested from the command line.
Now you can run "`ldc test.d -c -mem2reg -simplifycfg`" if you feel the urge.
The -O<N> options are still supported, and are inserted in the passes list in
the position where they appear on the command line.
(so -simplifycfg -O1 -instcombine does the "right thing")
One small change: -inline is renamed to -enable-inlining due to a naming
conflict with the option to add the -inline pass. -inline now inserts the
inlining pass in the position specified, not in the middle of -O<N>.
(ldmd has been updated to translate -inline to -enable-inlining)
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sun, 29 Mar 2009 15:46:55 +0200 |
parents | 7ce8355fbcc6 |
children | 29d3861aa2da |
line wrap: on
line diff
--- a/gen/cl_options.cpp Sun Mar 29 11:44:32 2009 +0200 +++ b/gen/cl_options.cpp Sun Mar 29 15:46:55 2009 +0200 @@ -20,16 +20,6 @@ cl::PositionalEatsArgs); - -// TODO: Replace this with a proper PassNameParser-based solution -static cl::opt<bool, true> doInline("inline", - cl::desc("Do function inlining"), - cl::location(global.params.llvmInline), - cl::ZeroOrMore, - cl::init(false)); - - - static cl::opt<bool, true> useDeprecated("d", cl::desc("Allow deprecated language features"), cl::ZeroOrMore, @@ -59,22 +49,6 @@ cl::ZeroOrMore, cl::location(global.params.warnings)); - -static cl::opt<char, true> optimizeLevel( - cl::desc("Setting the optimization level:"), - cl::ZeroOrMore, - cl::values( - clEnumValN(2, "O", "Equivalent to -O2"), - clEnumValN(0, "O0", "Trivial optimizations only"), - clEnumValN(1, "O1", "Simple optimizations"), - clEnumValN(2, "O2", "Good optimizations"), - clEnumValN(3, "O3", "Aggressive optimizations"), - clEnumValN(4, "O4", "Link-time optimization"), // not implemented? - clEnumValN(5, "O5", "Link-time optimization"), // not implemented? - clEnumValEnd), - cl::location(global.params.optimizeLevel), - cl::init(-1)); - static cl::opt<char, true> debugInfo( cl::desc("Generating debug information:"), cl::ZeroOrMore,