summaryrefslogtreecommitdiff
path: root/tools/llvmc
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvmc')
-rw-r--r--tools/llvmc/plugins/Base/Base.td.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/llvmc/plugins/Base/Base.td.in b/tools/llvmc/plugins/Base/Base.td.in
index ddf6a3654a..c26a567ba5 100644
--- a/tools/llvmc/plugins/Base/Base.td.in
+++ b/tools/llvmc/plugins/Base/Base.td.in
@@ -65,6 +65,18 @@ def OptList : OptionList<[
(help "Pass options to opt"))
]>;
+// Option preprocessor.
+
+def Preprocess : OptionPreprocessor<
+(case (and (switch_on "O3"), (any_switch_on ["O0", "O1", "O2"])),
+ (unset_option ["O0", "O1", "O2"]),
+ (and (switch_on "O2"), (any_switch_on ["O0", "O1"])),
+ (unset_option ["O0", "O1"]),
+ (and (switch_on "O1"), (switch_on "O0")),
+ (unset_option "O0"))
+>;
+
+
// Tools
class llvm_gcc_based <string cmd_prefix, string in_lang, string E_ext> : Tool<