Clang Project

clang_source_code/include/clang/Driver/Types.def
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).
42TYPE("cpp-output",               PP_C,         INVALID,         "i",     "u")
43TYPE("c",                        C,            PP_C,            "c",     "u")
44TYPE("cl",                       CL,           PP_C,            "cl",    "u")
45TYPE("cuda-cpp-output",          PP_CUDA,      INVALID,         "cui",   "u")
46TYPE("cuda",                     CUDA,         PP_CUDA,         "cu",    "u")
47TYPE("cuda",                     CUDA_DEVICE,  PP_CUDA,         "cu",    "")
48TYPE("hip-cpp-output",           PP_HIP,       INVALID,         "cui",   "u")
49TYPE("hip",                      HIP,          PP_HIP,          "cu",    "u")
50TYPE("hip",                      HIP_DEVICE,   PP_HIP,          "cu",    "")
51TYPE("objective-c-cpp-output",   PP_ObjC,      INVALID,         "mi",    "u")
52TYPE("objc-cpp-output",          PP_ObjC_Alias, INVALID,        "mi",    "u")
53TYPE("objective-c",              ObjC,         PP_ObjC,         "m",     "u")
54TYPE("c++-cpp-output",           PP_CXX,       INVALID,         "ii",    "u")
55TYPE("c++",                      CXX,          PP_CXX,          "cpp",   "u")
56TYPE("objective-c++-cpp-output", PP_ObjCXX,    INVALID,         "mii",   "u")
57TYPE("objc++-cpp-output",        PP_ObjCXX_Alias, INVALID,      "mii",   "u")
58TYPE("objective-c++",            ObjCXX,       PP_ObjCXX,       "mm",    "u")
59TYPE("renderscript",             RenderScript, PP_C,            "rs",    "u")
60
61// C family input files to precompile.
62TYPE("c-header-cpp-output",      PP_CHeader,   INVALID,         "i",     "p")
63TYPE("c-header",                 CHeader,      PP_CHeader,      "h",     "pu")
64TYPE("cl-header",                CLHeader,     PP_CHeader,      "h",     "pu")
65TYPE("objective-c-header-cpp-output", PP_ObjCHeader, INVALID,   "mi",    "p")
66TYPE("objective-c-header",       ObjCHeader,   PP_ObjCHeader,   "h",     "pu")
67TYPE("c++-header-cpp-output",    PP_CXXHeader, INVALID,         "ii",    "p")
68TYPE("c++-header",               CXXHeader,    PP_CXXHeader,    "hh",    "pu")
69TYPE("objective-c++-header-cpp-output", PP_ObjCXXHeader, INVALID, "mii", "p")
70TYPE("objective-c++-header",     ObjCXXHeader, PP_ObjCXXHeader, "h",     "pu")
71TYPE("c++-module",               CXXModule,    PP_CXXModule,    "cppm",  "mu")
72TYPE("c++-module-cpp-output",    PP_CXXModule, INVALID,         "iim",   "m")
73
74// Other languages.
75TYPE("ada",                      Ada,          INVALID,         nullptr, "u")
76TYPE("assembler",                PP_Asm,       INVALID,         "s",     "au")
77TYPE("assembler-with-cpp",       Asm,          PP_Asm,          "S",     "au")
78TYPE("f95",                      PP_Fortran,   INVALID,         nullptr, "u")
79TYPE("f95-cpp-input",            Fortran,      PP_Fortran,      nullptr, "u")
80TYPE("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.
84TYPE("ir",                       LLVM_IR,      INVALID,         "ll",    "u")
85TYPE("ir",                       LLVM_BC,      INVALID,         "bc",    "u")
86TYPE("lto-ir",                   LTO_IR,       INVALID,         "s",     "")
87TYPE("lto-bc",                   LTO_BC,       INVALID,         "o",     "")
88
89// Misc.
90TYPE("ast",                      AST,          INVALID,         "ast",   "u")
91TYPE("pcm",                      ModuleFile,   INVALID,         "pcm",   "u")
92TYPE("plist",                    Plist,        INVALID,         "plist", "")
93TYPE("rewritten-objc",           RewrittenObjC,INVALID,         "cpp",   "")
94TYPE("rewritten-legacy-objc",    RewrittenLegacyObjC,INVALID,   "cpp",   "")
95TYPE("remap",                    Remap,        INVALID,         "remap", "")
96TYPE("precompiled-header",       PCH,          INVALID,         "gch",   "A")
97TYPE("object",                   Object,       INVALID,         "o",     "")
98TYPE("treelang",                 Treelang,     INVALID,         nullptr, "u")
99TYPE("image",                    Image,        INVALID,         "out",   "")
100TYPE("dSYM",                     dSYM,         INVALID,         "dSYM",  "A")
101TYPE("dependencies",             Dependencies, INVALID,         "d",     "")
102TYPE("cuda-fatbin",              CUDA_FATBIN,  INVALID,         "fatbin","A")
103TYPE("hip-fatbin",               HIP_FATBIN,   INVALID,         "hipfb", "A")
104TYPE("none",                     Nothing,      INVALID,         nullptr, "u")
105