1 // A (first stab at a) replacement for the Clang's ccc script.
2 // To compile, use this command:
3 // make TOOLNAME=ccc GRAPH=examples/Clang.td
8 [(in_language ["c", "c++", "objective-c"]),
9 (out_language "llvm-bitcode"),
11 // TOFIX: We should be able to test the language of the input file
12 (cmd_line (case (switch_on "E"), "clang -E $INFILE",
13 (default), "clang -emit-llvm-bc $INFILE -o $OUTFILE")),
14 (switch_option "E", (stop_compilation), (output_suffix "i"),
15 (help "Stop after the preprocessing stage, do not run the compiler")),
21 [(in_language "llvm-bitcode"),
22 (out_language "executable"),
23 (output_suffix "out"),
24 (cmd_line "llvm-ld -native -disable-internalize $INFILE -o $OUTFILE"),
25 (prefix_list_option "L", (forward), (help "Specify a library search path")),
31 def LanguageMap : LanguageMap<
32 [LangToSuffixes<"c++", ["cc", "cp", "cxx", "cpp", "CPP", "c++", "C"]>,
33 LangToSuffixes<"c", ["c"]>,
34 LangToSuffixes<"objective-c", ["m"]>,
35 LangToSuffixes<"c-cpp-output", ["i"]>,
36 LangToSuffixes<"objective-c-cpp-output", ["mi"]>
41 def CompilationGraph : CompilationGraph<[