1 //===- Tools.td - Tools description for the LLVMCC --------*- tablegen -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains descriptions of the various build tools run by llvmcc.
12 //===----------------------------------------------------------------------===//
14 // Open issue: should we use DAG lists in Tool specifications
15 // or change to something like
16 // def LLVMGccC : < Tool<
18 // PrefixListOption<"Wl", [UnpackValues, PropertyName<Arg>, ...]>
20 // DAG lists look more aesthetically pleasing to me.
22 def llvm_gcc_c : Tool<
24 (out_language "llvm-bitcode"),
26 (cmd_line "llvm-gcc -c $INFILE -o $OUTFILE -emit-llvm"),
30 def llvm_gcc_cpp : Tool<
32 (out_language "llvm-bitcode"),
34 (cmd_line "llvm-g++ -c $INFILE -o $OUTFILE -emit-llvm"),
39 [(in_language "llvm-bitcode"),
40 (out_language "llvm-bitcode"),
42 (cmd_line "opt $INFILE -o $OUTFILE")
46 [(in_language "llvm-assembler"),
47 (out_language "llvm-bitcode"),
49 (cmd_line "llvm-as $INFILE -o $OUTFILE")
53 [(in_language "llvm-bitcode"),
54 (out_language "assembler"),
56 (cmd_line "llc $INFILE -o $OUTFILE")
59 def llvm_gcc_assembler : Tool<
60 [(in_language "assembler"),
61 (out_language "object-code"),
63 (cmd_line "llvm-gcc -c $INFILE -o $OUTFILE"),
64 (prefix_list_option "Wa", (unpack_values), (help "pass options to assembler"))
67 def llvm_gcc_linker : Tool<
68 [(in_language "object-code"),
69 (out_language "executable"),
70 (output_suffix "out"),
71 (cmd_line "llvm-gcc $INFILE -o $OUTFILE"),
73 (prefix_list_option "L", (forward), (help "add a directory to link path")),
74 (prefix_list_option "l", (forward), (help "search a library when linking")),
75 (prefix_list_option "Wl", (unpack_values), (help "pass options to linker"))
80 def LanguageMap : LanguageMap<
81 [LangToSuffixes<"c++", ["cc", "cp", "cxx", "cpp", "CPP", "c++", "C"]>,
82 LangToSuffixes<"c", ["c"]>,
83 LangToSuffixes<"assembler", ["s"]>,
84 LangToSuffixes<"llvm-assembler", ["ll"]>,
85 LangToSuffixes<"llvm-bitcode", ["bc"]>,
86 LangToSuffixes<"object-code", ["o"]>,
87 LangToSuffixes<"executable", ["out"]>]>;