clang 8.0.0

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