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)
This commit is contained in:
Frits van Bommel
2009-03-29 15:46:55 +02:00
parent f179acda32
commit e129494812
8 changed files with 115 additions and 54 deletions
-26
View File
@@ -20,16 +20,6 @@ cl::list<std::string> runargs("run",
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 @@ static cl::opt<bool, true> warnings("w",
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,