aboutsummaryrefslogtreecommitdiff
path: root/tools/llvmc/plugins/Base/Base.td
blob: 85a37cb41a7c0a5eb25082ff736562f82b0933c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//===- Base.td - LLVMC2 toolchain descriptions -------------*- tablegen -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains compilation graph description used by llvmc2.
//
//===----------------------------------------------------------------------===//

include "llvm/CompilerDriver/Common.td"
include "llvm/CompilerDriver/Tools.td"

// Toolchains

def CompilationGraph : CompilationGraph<[
    Edge<"root", "llvm_gcc_c">,
    Edge<"root", "llvm_gcc_assembler">,
    Edge<"root", "llvm_gcc_cpp">,
    Edge<"root", "llvm_gcc_m">,
    Edge<"root", "llvm_gcc_mxx">,
    Edge<"root", "llvm_as">,

    Edge<"llvm_gcc_c", "llc">,
    Edge<"llvm_gcc_cpp", "llc">,
    Edge<"llvm_gcc_m", "llc">,
    Edge<"llvm_gcc_mxx", "llc">,
    Edge<"llvm_as", "llc">,

    OptionalEdge<"llvm_gcc_c", "opt", (case (switch_on "opt"), (inc_weight))>,
    OptionalEdge<"llvm_gcc_cpp", "opt", (case (switch_on "opt"), (inc_weight))>,
    OptionalEdge<"llvm_gcc_m", "opt", (case (switch_on "opt"), (inc_weight))>,
    OptionalEdge<"llvm_gcc_mxx", "opt", (case (switch_on "opt"), (inc_weight))>,
    OptionalEdge<"llvm_as", "opt", (case (switch_on "opt"), (inc_weight))>,
    Edge<"opt", "llc">,

    Edge<"llc", "llvm_gcc_assembler">,
    Edge<"llvm_gcc_assembler", "llvm_gcc_linker">,
    OptionalEdge<"llvm_gcc_assembler", "llvm_gcc_cpp_linker",
                 (case
                     (or (input_languages_contain "c++"),
                         (input_languages_contain "objective-c++")),
                     (inc_weight),
                     (or (parameter_equals "linker", "g++"),
                         (parameter_equals "linker", "c++")), (inc_weight))>,


    Edge<"root", "llvm_gcc_linker">,
    OptionalEdge<"root", "llvm_gcc_cpp_linker",
                 (case
                     (or (input_languages_contain "c++"),
                         (input_languages_contain "objective-c++")),
                     (inc_weight),
                     (or (parameter_equals "linker", "g++"),
                         (parameter_equals "linker", "c++")), (inc_weight))>
    ]>;