clang  9.0.0svn
Types.h
Go to the documentation of this file.
1 //===--- Types.h - Input & Temporary Driver Types ---------------*- 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 #ifndef LLVM_CLANG_DRIVER_TYPES_H
10 #define LLVM_CLANG_DRIVER_TYPES_H
11 
12 #include "clang/Driver/Phases.h"
13 #include "llvm/ADT/SmallVector.h"
14 
15 namespace llvm {
16 class StringRef;
17 }
18 namespace clang {
19 namespace driver {
20 namespace types {
21  enum ID {
23 #define TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, FLAGS) TY_##ID,
24 #include "clang/Driver/Types.def"
25 #undef TYPE
27  };
28 
29  /// getTypeName - Return the name of the type for \p Id.
30  const char *getTypeName(ID Id);
31 
32  /// getPreprocessedType - Get the ID of the type for this input when
33  /// it has been preprocessed, or INVALID if this input is not
34  /// preprocessed.
36 
37  /// getPrecompiledType - Get the ID of the type for this input when
38  /// it has been precompiled, or INVALID if this input is not
39  /// precompiled.
41 
42  /// getTypeTempSuffix - Return the suffix to use when creating a
43  /// temp file of this type, or null if unspecified.
44  const char *getTypeTempSuffix(ID Id, bool CLMode = false);
45 
46  /// onlyAssembleType - Should this type only be assembled.
47  bool onlyAssembleType(ID Id);
48 
49  /// onlyPrecompileType - Should this type only be precompiled.
50  bool onlyPrecompileType(ID Id);
51 
52  /// canTypeBeUserSpecified - Can this type be specified on the
53  /// command line (by the type name); this is used when forwarding
54  /// commands to gcc.
56 
57  /// appendSuffixForType - When generating outputs of this type,
58  /// should the suffix be appended (instead of replacing the existing
59  /// suffix).
61 
62  /// canLipoType - Is this type acceptable as the output of a
63  /// universal build (currently, just the Nothing, Image, and Object
64  /// types).
65  bool canLipoType(ID Id);
66 
67  /// isAcceptedByClang - Can clang handle this input type.
68  bool isAcceptedByClang(ID Id);
69 
70  /// isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
71  bool isCXX(ID Id);
72 
73  /// Is this LLVM IR.
74  bool isLLVMIR(ID Id);
75 
76  /// isCuda - Is this a CUDA input.
77  bool isCuda(ID Id);
78 
79  /// isHIP - Is this a HIP input.
80  bool isHIP(ID Id);
81 
82  /// isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
83  bool isObjC(ID Id);
84 
85  /// isSrcFile - Is this a source file, i.e. something that still has to be
86  /// preprocessed. The logic behind this is the same that decides if the first
87  /// compilation phase is a preprocessing one.
88  bool isSrcFile(ID Id);
89 
90  /// lookupTypeForExtension - Lookup the type to use for the file
91  /// extension \p Ext.
92  ID lookupTypeForExtension(llvm::StringRef Ext);
93 
94  /// lookupTypeForTypSpecifier - Lookup the type to use for a user
95  /// specified type name.
96  ID lookupTypeForTypeSpecifier(const char *Name);
97 
98  /// getCompilationPhases - Get the list of compilation phases ('Phases') to be
99  /// done for type 'Id'.
101  ID Id,
103 
104  /// lookupCXXTypeForCType - Lookup CXX input type that corresponds to given
105  /// C type (used for clang++ emulation of g++ behaviour)
107 
108  /// Lookup header file input type that corresponds to given
109  /// source file type (used for clang-cl emulation of \Yc).
111 
112 } // end namespace types
113 } // end namespace driver
114 } // end namespace clang
115 
116 #endif
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
Definition: Dominators.h:29
bool canLipoType(ID Id)
canLipoType - Is this type acceptable as the output of a universal build (currently, just the Nothing, Image, and Object types).
Definition: Types.cpp:87
const char * getTypeTempSuffix(ID Id, bool CLMode=false)
getTypeTempSuffix - Return the suffix to use when creating a temp file of this type, or null if unspecified.
Definition: Types.cpp:54
bool onlyAssembleType(ID Id)
onlyAssembleType - Should this type only be assembled.
Definition: Types.cpp:71
bool canTypeBeUserSpecified(ID Id)
canTypeBeUserSpecified - Can this type be specified on the command line (by the type name); this is u...
Definition: Types.cpp:79
ID lookupCXXTypeForCType(ID Id)
lookupCXXTypeForCType - Lookup CXX input type that corresponds to given C type (used for clang++ emul...
Definition: Types.cpp:293
bool isHIP(ID Id)
isHIP - Is this a HIP input.
Definition: Types.cpp:178
ID getPreprocessedType(ID Id)
getPreprocessedType - Get the ID of the type for this input when it has been preprocessed, or INVALID if this input is not preprocessed.
Definition: Types.cpp:42
ID lookupHeaderTypeForSourceType(ID Id)
Lookup header file input type that corresponds to given source file type (used for clang-cl emulation...
Definition: Types.cpp:309
const char * getTypeName(ID Id)
getTypeName - Return the name of the type for Id.
Definition: Types.cpp:38
int Id
Definition: ASTDiff.cpp:190
void getCompilationPhases(ID Id, llvm::SmallVectorImpl< phases::ID > &Phases)
getCompilationPhases - Get the list of compilation phases (&#39;Phases&#39;) to be done for type &#39;Id&#39;...
Definition: Types.cpp:267
bool isCuda(ID Id)
isCuda - Is this a CUDA input.
Definition: Types.cpp:166
bool isAcceptedByClang(ID Id)
isAcceptedByClang - Can clang handle this input type.
Definition: Types.cpp:94
Dataflow Directional Tag Classes.
ID getPrecompiledType(ID Id)
getPrecompiledType - Get the ID of the type for this input when it has been precompiled, or INVALID if this input is not precompiled.
Definition: Types.cpp:46
bool isCXX(ID Id)
isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
Definition: Types.cpp:135
ID lookupTypeForExtension(llvm::StringRef Ext)
lookupTypeForExtension - Lookup the type to use for the file extension Ext.
Definition: Types.cpp:194
bool onlyPrecompileType(ID Id)
onlyPrecompileType - Should this type only be precompiled.
Definition: Types.cpp:75
bool appendSuffixForType(ID Id)
appendSuffixForType - When generating outputs of this type, should the suffix be appended (instead of...
Definition: Types.cpp:83
ID lookupTypeForTypeSpecifier(const char *Name)
lookupTypeForTypSpecifier - Lookup the type to use for a user specified type name.
Definition: Types.cpp:255
bool isLLVMIR(ID Id)
Is this LLVM IR.
Definition: Types.cpp:153
bool isSrcFile(ID Id)
isSrcFile - Is this a source file, i.e.
Definition: Types.cpp:190
bool isObjC(ID Id)
isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
Definition: Types.cpp:122