mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +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"
|
||||
|
||||
|
||||
def Options : OptionList<[
|
||||
(switch_option "E",
|
||||
(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),
|
||||
(out_language "llvm-bitcode"),
|
||||
(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")),
|
||||
(sink)
|
||||
]>;
|
||||
|
||||
def clang_c : 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_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")>;
|
||||
def clang_c : clang_based<"c", "clang -x c">;
|
||||
def clang_cpp : clang_based<"c++", "clang -x c++">;
|
||||
def clang_objective_c : clang_based<"objective-c", "clang -x objective-c">;
|
||||
def clang_objective_cpp : clang_based<"objective-c++",
|
||||
"clang -x objective-c++">;
|
||||
|
||||
// Default linker
|
||||
def llvm_ld : Tool<
|
||||
|
Loading…
Reference in New Issue
Block a user