Update mcc16 and the ancient Clang plugin for the 'cmd_line' -> 'command' change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96933 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mikhail Glushenkov 2010-02-23 09:59:30 +00:00
parent 112257d290
commit 9e7d90bcfc
3 changed files with 32 additions and 38 deletions

View File

@ -10,7 +10,7 @@
LEVEL = ../.. LEVEL = ../..
export LLVMC_BASED_DRIVER_NAME = llvmc export LLVMC_BASED_DRIVER_NAME = llvmc
export LLVMC_BUILTIN_PLUGINS = Base export LLVMC_BUILTIN_PLUGINS = Base Clang
REQUIRES_RTTI = 1 REQUIRES_RTTI = 1
DIRS = plugins driver DIRS = plugins driver

View File

@ -72,16 +72,14 @@ class clang_based<string language, string cmd, string ext_E> : Tool<
[(in_language language), [(in_language language),
(out_language "llvm-bitcode"), (out_language "llvm-bitcode"),
(output_suffix "bc"), (output_suffix "bc"),
(cmd_line (case (command cmd),
(switch_on "E"), (actions (case
(case (and (multiple_input_files),
(not_empty "o"), !strconcat(cmd, " -E $INFILE -o $OUTFILE"), (or (switch_on "S"), (switch_on "c"))),
(default), !strconcat(cmd, " -E $INFILE")), (error "cannot specify -o with -c or -S with multiple files"),
(default), !strconcat(cmd, " $INFILE -o $OUTFILE"))), (switch_on "E"), [(forward "E"),
(actions (case (stop_compilation), (output_suffix ext_E)],
(and (multiple_input_files), (or (switch_on "S"), (switch_on "c"))), (and (switch_on "E"), (empty "o")), (no_out_file),
(error "cannot specify -o with -c or -S with multiple files"),
(switch_on "E"), [(stop_compilation), (output_suffix ext_E)],
(switch_on "bc"),[(stop_compilation), (output_suffix "bc")], (switch_on "bc"),[(stop_compilation), (output_suffix "bc")],
(switch_on "g"), (append_cmd "-g"), (switch_on "g"), (append_cmd "-g"),
(switch_on "w"), (append_cmd "-w"), (switch_on "w"), (append_cmd "-w"),
@ -116,12 +114,13 @@ def llvm_ld : Tool<[
(in_language "llvm-bitcode"), (in_language "llvm-bitcode"),
(out_language "llvm-bitcode"), (out_language "llvm-bitcode"),
(output_suffix "bc"), (output_suffix "bc"),
(cmd_line "$CALL(GetBinDir)llvm-ld -L $CALL(GetStdLibsDir) -disable-gvn -disable-licm-promotion -disable-mem2reg $INFILE -b $OUTFILE -l std"), (command "$CALL(GetBinDir)llvm-ld -L $CALL(GetStdLibsDir) -disable-gvn -disable-licm-promotion -disable-mem2reg -l std"),
(out_file_option "-b"),
(actions (case (actions (case
(switch_on "O0"), (append_cmd "-disable-opt"), (switch_on "O0"), (append_cmd "-disable-opt"),
(switch_on "O1"), (append_cmd "-disable-opt"), (switch_on "O1"), (append_cmd "-disable-opt"),
// Whenever O3 is not specified on the command line, default i.e. disable-inlining will always be added. // Whenever O3 is not specified on the command line, default i.e. disable-inlining will always be added.
(switch_on "O2"), (append_cmd ""), (switch_on "O2"), (append_cmd ""),
(switch_on "O3"), (append_cmd ""), (switch_on "O3"), (append_cmd ""),
(default), (append_cmd "-disable-inlining"))), (default), (append_cmd "-disable-inlining"))),
(join) (join)
@ -134,12 +133,13 @@ def llvm_ld_optimizer : Tool<[
(output_suffix "bc"), (output_suffix "bc"),
// FIXME: we are still not disabling licm-promotion. // FIXME: we are still not disabling licm-promotion.
// -disable-licm-promotion and building stdn library causes c16-71 to fail. // -disable-licm-promotion and building stdn library causes c16-71 to fail.
(cmd_line "$CALL(GetBinDir)llvm-ld -disable-gvn -disable-mem2reg $INFILE -b $OUTFILE"), (command "$CALL(GetBinDir)llvm-ld -disable-gvn -disable-mem2reg"),
(out_file_option "-b"),
(actions (case (actions (case
(switch_on "O0"), (append_cmd "-disable-opt"), (switch_on "O0"), (append_cmd "-disable-opt"),
(switch_on "O1"), (append_cmd "-disable-opt"), (switch_on "O1"), (append_cmd "-disable-opt"),
// Whenever O3 is not specified on the command line, default i.e. disable-inlining will always be added. // Whenever O3 is not specified on the command line, default i.e. disable-inlining will always be added.
(switch_on "O2"), (append_cmd ""), (switch_on "O2"), (append_cmd ""),
(switch_on "O3"), (append_cmd ""), (switch_on "O3"), (append_cmd ""),
(default), (append_cmd "-disable-inlining"))) (default), (append_cmd "-disable-inlining")))
]>; ]>;
@ -149,7 +149,7 @@ def pic16passes : Tool<[
(in_language "llvm-bitcode"), (in_language "llvm-bitcode"),
(out_language "llvm-bitcode"), (out_language "llvm-bitcode"),
(output_suffix "obc"), (output_suffix "obc"),
(cmd_line "$CALL(GetBinDir)opt -pic16cg -pic16overlay $INFILE -f -o $OUTFILE"), (command "$CALL(GetBinDir)opt -pic16cg -pic16overlay -f"),
(actions (case (actions (case
(switch_on "O0"), (append_cmd "-disable-opt"))) (switch_on "O0"), (append_cmd "-disable-opt")))
]>; ]>;
@ -158,7 +158,7 @@ def llc : Tool<[
(in_language "llvm-bitcode"), (in_language "llvm-bitcode"),
(out_language "assembler"), (out_language "assembler"),
(output_suffix "s"), (output_suffix "s"),
(cmd_line "$CALL(GetBinDir)llc -march=pic16 -disable-jump-tables -pre-RA-sched=list-burr -f $INFILE -o $OUTFILE"), (command "$CALL(GetBinDir)llc -march=pic16 -disable-jump-tables -pre-RA-sched=list-burr -f"),
(actions (case (actions (case
(switch_on "S"), (stop_compilation), (switch_on "S"), (stop_compilation),
// (not_empty "Wllc,"), (unpack_values "Wllc,"), // (not_empty "Wllc,"), (unpack_values "Wllc,"),
@ -171,7 +171,7 @@ def gpasm : Tool<[
(in_language "assembler"), (in_language "assembler"),
(out_language "object-code"), (out_language "object-code"),
(output_suffix "o"), (output_suffix "o"),
(cmd_line "$CALL(GetBinDir)gpasm -z -r decimal -I $CALL(GetStdAsmHeadersDir) -C -c -w 2 $INFILE -o $OUTFILE"), (command "$CALL(GetBinDir)gpasm -z -r decimal -I $CALL(GetStdAsmHeadersDir) -C -c -w 2"),
(actions (case (actions (case
(switch_on "c"), (stop_compilation), (switch_on "c"), (stop_compilation),
(switch_on "g"), (append_cmd "-g"), (switch_on "g"), (append_cmd "-g"),
@ -184,7 +184,7 @@ def mplink : Tool<[
(in_language "object-code"), (in_language "object-code"),
(out_language "executable"), (out_language "executable"),
(output_suffix "cof"), (output_suffix "cof"),
(cmd_line "$CALL(GetBinDir)mplink -e -k $CALL(GetStdLinkerScriptsDir) -l $CALL(GetStdLibsDir) intrinsics.lib stdn.lib $INFILE -o $OUTFILE"), (command "$CALL(GetBinDir)mplink -e -k $CALL(GetStdLinkerScriptsDir) -l $CALL(GetStdLibsDir) intrinsics.lib stdn.lib"),
(actions (case (actions (case
(not_empty "Wl,"), (forward_value "Wl,"), (not_empty "Wl,"), (forward_value "Wl,"),
(switch_on "X"), (append_cmd "-x"), (switch_on "X"), (append_cmd "-x"),
@ -217,13 +217,13 @@ def LanguageMap : LanguageMap<[
def CompilationGraph : CompilationGraph<[ def CompilationGraph : CompilationGraph<[
Edge<"root", "clang_cc">, Edge<"root", "clang_cc">,
Edge<"root", "llvm_ld">, Edge<"root", "llvm_ld">,
OptionalEdge<"root", "llvm_ld_optimizer", (case OptionalEdge<"root", "llvm_ld_optimizer", (case
(switch_on "S"), (inc_weight), (switch_on "S"), (inc_weight),
(switch_on "c"), (inc_weight))>, (switch_on "c"), (inc_weight))>,
Edge<"root", "gpasm">, Edge<"root", "gpasm">,
Edge<"root", "mplink">, Edge<"root", "mplink">,
Edge<"clang_cc", "llvm_ld">, Edge<"clang_cc", "llvm_ld">,
OptionalEdge<"clang_cc", "llvm_ld_optimizer", (case OptionalEdge<"clang_cc", "llvm_ld_optimizer", (case
(switch_on "S"), (inc_weight), (switch_on "S"), (inc_weight),
(switch_on "c"), (inc_weight))>, (switch_on "c"), (inc_weight))>,
Edge<"llvm_ld", "pic16passes">, Edge<"llvm_ld", "pic16passes">,

View File

@ -24,23 +24,17 @@ class clang_based<string language, string cmd, string ext_E> : Tool<
[(in_language language), [(in_language language),
(out_language "llvm-bitcode"), (out_language "llvm-bitcode"),
(output_suffix "bc"), (output_suffix "bc"),
(cmd_line (case (command cmd),
(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"))),
(actions (case (switch_on "E"), (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), (switch_on "fsyntax-only"), (stop_compilation),
(and (switch_on "S"), (switch_on "emit-llvm")), (switch_on ["S", "emit-llvm"]),
[(stop_compilation), (output_suffix "ll")], [(append_cmd "-emit-llvm"),
(and (switch_on "c"), (switch_on "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), (stop_compilation),
(not_empty "include"), (forward "include"), (not_empty "include"), (forward "include"),
(not_empty "I"), (forward "I"))), (not_empty "I"), (forward "I"))),
@ -58,7 +52,7 @@ def as : Tool<
[(in_language "assembler"), [(in_language "assembler"),
(out_language "object-code"), (out_language "object-code"),
(output_suffix "o"), (output_suffix "o"),
(cmd_line "as $INFILE -o $OUTFILE"), (command "as"),
(actions (case (not_empty "Wa,"), (forward_value "Wa,"), (actions (case (not_empty "Wa,"), (forward_value "Wa,"),
(switch_on "c"), (stop_compilation))) (switch_on "c"), (stop_compilation)))
]>; ]>;
@ -68,7 +62,7 @@ def llvm_ld : Tool<
[(in_language "object-code"), [(in_language "object-code"),
(out_language "executable"), (out_language "executable"),
(output_suffix "out"), (output_suffix "out"),
(cmd_line "llvm-ld -native -disable-internalize $INFILE -o $OUTFILE"), (command "llvm-ld -native -disable-internalize"),
(actions (case (actions (case
(switch_on "pthread"), (append_cmd "-lpthread"), (switch_on "pthread"), (append_cmd "-lpthread"),
(not_empty "L"), (forward "L"), (not_empty "L"), (forward "L"),