diff options
Diffstat (limited to 'tools/llvmc/plugins/Clang/Clang.td')
-rw-r--r-- | tools/llvmc/plugins/Clang/Clang.td | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/tools/llvmc/plugins/Clang/Clang.td b/tools/llvmc/plugins/Clang/Clang.td index ac8ac15..988d9b1 100644 --- a/tools/llvmc/plugins/Clang/Clang.td +++ b/tools/llvmc/plugins/Clang/Clang.td @@ -1,12 +1,3 @@ -// A replacement for the Clang's ccc script. -// Depends on the Base plugin. -// To compile, use this command: -// -// cd $LLVMC2_DIR -// make DRIVER_NAME=ccc2 BUILTIN_PLUGINS=Clang -// -// Or just use the default llvmc, which now has this plugin enabled. - include "llvm/CompilerDriver/Common.td" def Priority : PluginPriority<1>; @@ -33,23 +24,17 @@ class clang_based<string language, string cmd, string ext_E> : Tool< [(in_language language), (out_language "llvm-bitcode"), (output_suffix "bc"), - (cmd_line (case - (switch_on "E"), - (case - (not_empty "o"), - !strconcat(cmd, " -E $INFILE -o $OUTFILE"), - (default), - !strconcat(cmd, " -E $INFILE")), - (and (switch_on "S"), (switch_on "emit-llvm")), - !strconcat(cmd, " -emit-llvm $INFILE -o $OUTFILE"), - (default), - !strconcat(cmd, " -emit-llvm-bc $INFILE -o $OUTFILE"))), + (command cmd), (actions (case (switch_on "E"), - [(stop_compilation), (output_suffix ext_E)], + [(forward "E"), (stop_compilation), (output_suffix ext_E)], + (and (switch_on "E"), (empty "o")), (no_out_file), (switch_on "fsyntax-only"), (stop_compilation), - (and (switch_on "S"), (switch_on "emit-llvm")), - [(stop_compilation), (output_suffix "ll")], - (and (switch_on "c"), (switch_on "emit-llvm")), + (switch_on ["S", "emit-llvm"]), + [(append_cmd "-emit-llvm"), + (stop_compilation), (output_suffix "ll")], + (not (switch_on ["S", "emit-llvm"])), + (append_cmd "-emit-llvm-bc"), + (switch_on ["c", "emit-llvm"]), (stop_compilation), (not_empty "include"), (forward "include"), (not_empty "I"), (forward "I"))), @@ -67,7 +52,7 @@ def as : Tool< [(in_language "assembler"), (out_language "object-code"), (output_suffix "o"), - (cmd_line "as $INFILE -o $OUTFILE"), + (command "as"), (actions (case (not_empty "Wa,"), (forward_value "Wa,"), (switch_on "c"), (stop_compilation))) ]>; @@ -77,7 +62,7 @@ def llvm_ld : Tool< [(in_language "object-code"), (out_language "executable"), (output_suffix "out"), - (cmd_line "llvm-ld -native -disable-internalize $INFILE -o $OUTFILE"), + (command "llvm-ld -native -disable-internalize"), (actions (case (switch_on "pthread"), (append_cmd "-lpthread"), (not_empty "L"), (forward "L"), |