1 | //===--- Types.def - Driver Type info ---------------------------*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | // |
9 | // This file defines the driver type information. Users of this file |
10 | // must define the TYPE macro to make use of this information. |
11 | // |
12 | //===----------------------------------------------------------------------===// |
13 | |
14 | #ifndef TYPE |
15 | #error "Define TYPE prior to including this file!" |
16 | #endif |
17 | |
18 | // TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, FLAGS) |
19 | |
20 | // The first value is the type name as a string; for types which can |
21 | // be user specified this should be the equivalent -x option. |
22 | |
23 | // The second value is the type id, which will result in a |
24 | // clang::driver::types::TY_XX enum constant. |
25 | |
26 | // The third value is that id of the type for preprocessed inputs of |
27 | // this type, or INVALID if this type is not preprocessed. |
28 | |
29 | // The fourth value is the suffix to use when creating temporary files |
30 | // of this type, or null if unspecified. |
31 | |
32 | // The fifth value is a string containing option flags. Valid values: |
33 | // a - The type should only be assembled. |
34 | // p - The type should only be precompiled. |
35 | // u - The type can be user specified (with -x). |
36 | // m - Precompiling this type produces a module file. |
37 | // A - The type's temporary suffix should be appended when generating |
38 | // outputs of this type. |
39 | |
40 | |
41 | // C family source language (with and without preprocessing). |
42 | TYPE("cpp-output", PP_C, INVALID, "i", "u") |
43 | TYPE("c", C, PP_C, "c", "u") |
44 | TYPE("cl", CL, PP_C, "cl", "u") |
45 | TYPE("cuda-cpp-output", PP_CUDA, INVALID, "cui", "u") |
46 | TYPE("cuda", CUDA, PP_CUDA, "cu", "u") |
47 | TYPE("cuda", CUDA_DEVICE, PP_CUDA, "cu", "") |
48 | TYPE("hip-cpp-output", PP_HIP, INVALID, "cui", "u") |
49 | TYPE("hip", HIP, PP_HIP, "cu", "u") |
50 | TYPE("hip", HIP_DEVICE, PP_HIP, "cu", "") |
51 | TYPE("objective-c-cpp-output", PP_ObjC, INVALID, "mi", "u") |
52 | TYPE("objc-cpp-output", PP_ObjC_Alias, INVALID, "mi", "u") |
53 | TYPE("objective-c", ObjC, PP_ObjC, "m", "u") |
54 | TYPE("c++-cpp-output", PP_CXX, INVALID, "ii", "u") |
55 | TYPE("c++", CXX, PP_CXX, "cpp", "u") |
56 | TYPE("objective-c++-cpp-output", PP_ObjCXX, INVALID, "mii", "u") |
57 | TYPE("objc++-cpp-output", PP_ObjCXX_Alias, INVALID, "mii", "u") |
58 | TYPE("objective-c++", ObjCXX, PP_ObjCXX, "mm", "u") |
59 | TYPE("renderscript", RenderScript, PP_C, "rs", "u") |
60 | |
61 | // C family input files to precompile. |
62 | TYPE("c-header-cpp-output", PP_CHeader, INVALID, "i", "p") |
63 | TYPE("c-header", CHeader, PP_CHeader, "h", "pu") |
64 | TYPE("cl-header", CLHeader, PP_CHeader, "h", "pu") |
65 | TYPE("objective-c-header-cpp-output", PP_ObjCHeader, INVALID, "mi", "p") |
66 | TYPE("objective-c-header", ObjCHeader, PP_ObjCHeader, "h", "pu") |
67 | TYPE("c++-header-cpp-output", PP_CXXHeader, INVALID, "ii", "p") |
68 | TYPE("c++-header", CXXHeader, PP_CXXHeader, "hh", "pu") |
69 | TYPE("objective-c++-header-cpp-output", PP_ObjCXXHeader, INVALID, "mii", "p") |
70 | TYPE("objective-c++-header", ObjCXXHeader, PP_ObjCXXHeader, "h", "pu") |
71 | TYPE("c++-module", CXXModule, PP_CXXModule, "cppm", "mu") |
72 | TYPE("c++-module-cpp-output", PP_CXXModule, INVALID, "iim", "m") |
73 | |
74 | // Other languages. |
75 | TYPE("ada", Ada, INVALID, nullptr, "u") |
76 | TYPE("assembler", PP_Asm, INVALID, "s", "au") |
77 | TYPE("assembler-with-cpp", Asm, PP_Asm, "S", "au") |
78 | TYPE("f95", PP_Fortran, INVALID, nullptr, "u") |
79 | TYPE("f95-cpp-input", Fortran, PP_Fortran, nullptr, "u") |
80 | TYPE("java", Java, INVALID, nullptr, "u") |
81 | |
82 | // LLVM IR/LTO types. We define separate types for IR and LTO because LTO |
83 | // outputs should use the standard suffixes. |
84 | TYPE("ir", LLVM_IR, INVALID, "ll", "u") |
85 | TYPE("ir", LLVM_BC, INVALID, "bc", "u") |
86 | TYPE("lto-ir", LTO_IR, INVALID, "s", "") |
87 | TYPE("lto-bc", LTO_BC, INVALID, "o", "") |
88 | |
89 | // Misc. |
90 | TYPE("ast", AST, INVALID, "ast", "u") |
91 | TYPE("pcm", ModuleFile, INVALID, "pcm", "u") |
92 | TYPE("plist", Plist, INVALID, "plist", "") |
93 | TYPE("rewritten-objc", RewrittenObjC,INVALID, "cpp", "") |
94 | TYPE("rewritten-legacy-objc", RewrittenLegacyObjC,INVALID, "cpp", "") |
95 | TYPE("remap", Remap, INVALID, "remap", "") |
96 | TYPE("precompiled-header", PCH, INVALID, "gch", "A") |
97 | TYPE("object", Object, INVALID, "o", "") |
98 | TYPE("treelang", Treelang, INVALID, nullptr, "u") |
99 | TYPE("image", Image, INVALID, "out", "") |
100 | TYPE("dSYM", dSYM, INVALID, "dSYM", "A") |
101 | TYPE("dependencies", Dependencies, INVALID, "d", "") |
102 | TYPE("cuda-fatbin", CUDA_FATBIN, INVALID, "fatbin","A") |
103 | TYPE("hip-fatbin", HIP_FATBIN, INVALID, "hipfb", "A") |
104 | TYPE("none", Nothing, INVALID, nullptr, "u") |
105 | |