diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2009-10-17 20:07:49 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2009-10-17 20:07:49 +0000 |
commit | 6b4967e1a679c61f3eb216446dd9ead906f82f3c (patch) | |
tree | 03fbbe115f707bd949bb30b58b81123038fcc9ff /tools | |
parent | 2bb6f6ae7adce90c87453fc333ef2b4d24ac71aa (diff) | |
download | external_llvm-6b4967e1a679c61f3eb216446dd9ead906f82f3c.zip external_llvm-6b4967e1a679c61f3eb216446dd9ead906f82f3c.tar.gz external_llvm-6b4967e1a679c61f3eb216446dd9ead906f82f3c.tar.bz2 |
-O[0-3] options should be also forwarded to opt and llc.
This will require implementing OptionPreprocessor to forbid invalid invocations
such as 'llvmc -O1 -O2'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvmc/plugins/Base/Base.td.in | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tools/llvmc/plugins/Base/Base.td.in b/tools/llvmc/plugins/Base/Base.td.in index be325a0..ddf6a36 100644 --- a/tools/llvmc/plugins/Base/Base.td.in +++ b/tools/llvmc/plugins/Base/Base.td.in @@ -24,6 +24,14 @@ def OptList : OptionList<[ (help "Stop after checking the input for syntax errors")), (switch_option "opt", (help "Enable opt")), + (switch_option "O0", + (help "Turn off optimization")), + (switch_option "O1", + (help "Optimization level 1")), + (switch_option "O2", + (help "Optimization level 2")), + (switch_option "O3", + (help "Optimization level 3")), (switch_option "S", (help "Stop after compilation, do not assemble")), (switch_option "c", @@ -87,6 +95,9 @@ class llvm_gcc_based <string cmd_prefix, string in_lang, string E_ext> : Tool< (not_empty "include"), (forward "include"), (not_empty "I"), (forward "I"), (not_empty "D"), (forward "D"), + (switch_on "O1"), (forward "O1"), + (switch_on "O2"), (forward "O2"), + (switch_on "O3"), (forward "O3"), (not_empty "MF"), (forward "MF"), (not_empty "MT"), (forward "MT"))), (sink) @@ -103,7 +114,10 @@ def opt : Tool< [(in_language "llvm-bitcode"), (out_language "llvm-bitcode"), (output_suffix "bc"), - (actions (case (not_empty "Wo,"), (unpack_values "Wo,"))), + (actions (case (not_empty "Wo,"), (unpack_values "Wo,"), + (switch_on "O1"), (forward "O1"), + (switch_on "O2"), (forward "O2"), + (switch_on "O3"), (forward "O3"))), (cmd_line "opt -f $INFILE -o $OUTFILE") ]>; @@ -132,6 +146,10 @@ def llc : Tool< (cmd_line "llc -f $INFILE -o $OUTFILE"), (actions (case (switch_on "S"), (stop_compilation), + (switch_on "O0"), (forward "O0"), + (switch_on "O1"), (forward "O1"), + (switch_on "O2"), (forward "O2"), + (switch_on "O3"), (forward "O3"), (not_empty "Wllc,"), (unpack_values "Wllc,"))) ]>; |