Types.def revision 6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89
1//===--- Types.def - Driver Type info ---------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the driver type information. Users of this file
11// must define the TYPE macro to make use of this information.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef TYPE
16#error "Define TYPE prior to including this file!"
17#endif
18
19// TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, FLAGS)
20
21// The first value is the type name as a string; for types which can
22// be user specified this should be the equivalent -x option.
23
24// The second value is the type id, which will result in a
25// clang::driver::types::TY_XX enum constant.
26
27// The third value is that id of the type for preprocessed inputs of
28// this type, or INVALID if this type is not preprocessed.
29
30// The fourth value is the suffix to use when creating temporary files
31// of this type, or null if unspecified.
32
33// The fifth value is a string containing option flags. Valid values:
34//  a - The type should only be assembled.
35//  p - The type should only be precompiled.
36//  u - The type can be user specified (with -x).
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",                     CUDA,         PP_CXX,          "cpp",   "u")
46TYPE("objective-c-cpp-output",   PP_ObjC,      INVALID,         "mi",    "u")
47TYPE("objc-cpp-output",          PP_ObjC_Alias, INVALID,        "mi",    "u")
48TYPE("objective-c",              ObjC,         PP_ObjC,         "m",     "u")
49TYPE("c++-cpp-output",           PP_CXX,       INVALID,         "ii",    "u")
50TYPE("c++",                      CXX,          PP_CXX,          "cpp",   "u")
51TYPE("objective-c++-cpp-output", PP_ObjCXX,    INVALID,         "mii",   "u")
52TYPE("objc++-cpp-output",        PP_ObjCXX_Alias, INVALID,      "mii",   "u")
53TYPE("objective-c++",            ObjCXX,       PP_ObjCXX,       "mm",    "u")
54
55// C family input files to precompile.
56TYPE("c-header-cpp-output",      PP_CHeader,   INVALID,         "i",     "p")
57TYPE("c-header",                 CHeader,      PP_CHeader,      nullptr, "pu")
58TYPE("cl-header",                CLHeader,     PP_CHeader,      nullptr, "pu")
59TYPE("objective-c-header-cpp-output", PP_ObjCHeader, INVALID,   "mi",    "p")
60TYPE("objective-c-header",       ObjCHeader,   PP_ObjCHeader,   nullptr, "pu")
61TYPE("c++-header-cpp-output",    PP_CXXHeader, INVALID,         "ii",    "p")
62TYPE("c++-header",               CXXHeader,    PP_CXXHeader,    nullptr, "pu")
63TYPE("objective-c++-header-cpp-output", PP_ObjCXXHeader, INVALID, "mii", "p")
64TYPE("objective-c++-header",     ObjCXXHeader, PP_ObjCXXHeader, nullptr, "pu")
65
66// Other languages.
67TYPE("ada",                      Ada,          INVALID,         nullptr, "u")
68TYPE("assembler",                PP_Asm,       INVALID,         "s",     "au")
69TYPE("assembler-with-cpp",       Asm,          PP_Asm,          "S",     "au")
70TYPE("f95",                      PP_Fortran,   INVALID,         nullptr, "u")
71TYPE("f95-cpp-input",            Fortran,      PP_Fortran,      nullptr, "u")
72TYPE("java",                     Java,         INVALID,         nullptr, "u")
73
74// LLVM IR/LTO types. We define separate types for IR and LTO because LTO
75// outputs should use the standard suffixes.
76TYPE("ir",                       LLVM_IR,      INVALID,         "ll",    "u")
77TYPE("ir",                       LLVM_BC,      INVALID,         "bc",    "u")
78TYPE("lto-ir",                   LTO_IR,       INVALID,         "s",     "")
79TYPE("lto-bc",                   LTO_BC,       INVALID,         "o",     "")
80
81// Misc.
82TYPE("ast",                      AST,          INVALID,         "ast",   "u")
83TYPE("pcm",                      ModuleFile,   INVALID,         "pcm",   "u")
84TYPE("plist",                    Plist,        INVALID,         "plist", "")
85TYPE("rewritten-objc",           RewrittenObjC,INVALID,         "cpp",   "")
86TYPE("rewritten-legacy-objc",    RewrittenLegacyObjC,INVALID,   "cpp",   "")
87TYPE("remap",                    Remap,        INVALID,         "remap", "")
88TYPE("precompiled-header",       PCH,          INVALID,         "gch",   "A")
89TYPE("object",                   Object,       INVALID,         "o",     "")
90TYPE("treelang",                 Treelang,     INVALID,         nullptr, "u")
91TYPE("image",                    Image,        INVALID,         "out",   "")
92TYPE("dSYM",                     dSYM,         INVALID,         "dSYM",  "A")
93TYPE("dependencies",             Dependencies, INVALID,         "d",     "")
94TYPE("none",                     Nothing,      INVALID,         nullptr, "u")
95