mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-05 12:31:33 +00:00
Scrap some boilerplate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60200 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ad746beb64
commit
bfdef3a6b2
@ -5,53 +5,33 @@
|
|||||||
|
|
||||||
include "llvm/CompilerDriver/Common.td"
|
include "llvm/CompilerDriver/Common.td"
|
||||||
|
|
||||||
|
|
||||||
def Options : OptionList<[
|
def Options : OptionList<[
|
||||||
(switch_option "E",
|
(switch_option "E",
|
||||||
(help "Stop after the preprocessing stage, do not run the compiler"))
|
(help "Stop after the preprocessing stage, do not run the compiler"))
|
||||||
]>;
|
]>;
|
||||||
|
|
||||||
class clang_base<string language, dag cmdline> : Tool<
|
class clang_based<string language, string cmd> : Tool<
|
||||||
[(in_language language),
|
[(in_language language),
|
||||||
(out_language "llvm-bitcode"),
|
(out_language "llvm-bitcode"),
|
||||||
(output_suffix "bc"),
|
(output_suffix "bc"),
|
||||||
(cmd_line cmdline),
|
(cmd_line (case
|
||||||
|
(switch_on "E"),
|
||||||
|
(case
|
||||||
|
(not_empty "o"),
|
||||||
|
!strconcat(cmd, " -E $INFILE -o $OUTFILE"),
|
||||||
|
(default),
|
||||||
|
!strconcat(cmd, " -E $INFILE")),
|
||||||
|
(default),
|
||||||
|
!strconcat(cmd, " -emit-llvm-bc $INFILE -o $OUTFILE"))),
|
||||||
(switch_option "E", (stop_compilation), (output_suffix "i")),
|
(switch_option "E", (stop_compilation), (output_suffix "i")),
|
||||||
(sink)
|
(sink)
|
||||||
]>;
|
]>;
|
||||||
|
|
||||||
def clang_c : clang_base<"c",
|
def clang_c : clang_based<"c", "clang -x c">;
|
||||||
(case
|
def clang_cpp : clang_based<"c++", "clang -x c++">;
|
||||||
(switch_on "E"),
|
def clang_objective_c : clang_based<"objective-c", "clang -x objective-c">;
|
||||||
(case
|
def clang_objective_cpp : clang_based<"objective-c++",
|
||||||
(not_empty "o"),
|
"clang -x objective-c++">;
|
||||||
"clang -E -x c $INFILE -o $OUTFILE",
|
|
||||||
(default),
|
|
||||||
"clang -E -x c $INFILE"),
|
|
||||||
(default),
|
|
||||||
"clang -emit-llvm-bc -x c $INFILE -o $OUTFILE")>;
|
|
||||||
|
|
||||||
def clang_cpp : clang_base<"c++",
|
|
||||||
(case
|
|
||||||
(switch_on "E"),
|
|
||||||
(case
|
|
||||||
(not_empty "o"),
|
|
||||||
"clang -E -x c++ $INFILE -o $OUTFILE",
|
|
||||||
(default),
|
|
||||||
"clang -E -x c++ $INFILE"),
|
|
||||||
(default),
|
|
||||||
"clang -emit-llvm-bc -x c++ $INFILE -o $OUTFILE")>;
|
|
||||||
|
|
||||||
def clang_objective_c : clang_base<"objective-c",
|
|
||||||
(case
|
|
||||||
(switch_on "E"),
|
|
||||||
(case
|
|
||||||
(not_empty "o"),
|
|
||||||
"clang -E -x objective-c $INFILE -o $OUTFILE",
|
|
||||||
(default),
|
|
||||||
"clang -E -x objective-c $INFILE"),
|
|
||||||
(default),
|
|
||||||
"clang -emit-llvm-bc -x objective-c $INFILE -o $OUTFILE")>;
|
|
||||||
|
|
||||||
// Default linker
|
// Default linker
|
||||||
def llvm_ld : Tool<
|
def llvm_ld : Tool<
|
||||||
|
Loading…
Reference in New Issue
Block a user