clang  10.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 #include "llvm/Option/ArgList.h"
15 
16 namespace llvm {
17 class StringRef;
18 }
19 namespace clang {
20 namespace driver {
21 class Driver;
22 namespace types {
23  enum ID {
25 #define TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, ...) TY_##ID,
26 #include "clang/Driver/Types.def"
27 #undef TYPE
29  };
30 
31  /// getTypeName - Return the name of the type for \p Id.
32  const char *getTypeName(ID Id);
33 
34  /// getPreprocessedType - Get the ID of the type for this input when
35  /// it has been preprocessed, or INVALID if this input is not
36  /// preprocessed.
38 
39  /// getPrecompiledType - Get the ID of the type for this input when
40  /// it has been precompiled, or INVALID if this input is not
41  /// precompiled.
43 
44  /// getTypeTempSuffix - Return the suffix to use when creating a
45  /// temp file of this type, or null if unspecified.
46  const char *getTypeTempSuffix(ID Id, bool CLMode = false);
47 
48  /// onlyAssembleType - Should this type only be assembled.
49  bool onlyAssembleType(ID Id);
50 
51  /// onlyPrecompileType - Should this type only be precompiled.
52  bool onlyPrecompileType(ID Id);
53 
54  /// canTypeBeUserSpecified - Can this type be specified on the
55  /// command line (by the type name); this is used when forwarding
56  /// commands to gcc.
58 
59  /// appendSuffixForType - When generating outputs of this type,
60  /// should the suffix be appended (instead of replacing the existing
61  /// suffix).
63 
64  /// canLipoType - Is this type acceptable as the output of a
65  /// universal build (currently, just the Nothing, Image, and Object
66  /// types).
67  bool canLipoType(ID Id);
68 
69  /// isAcceptedByClang - Can clang handle this input type.
70  bool isAcceptedByClang(ID Id);
71 
72  /// isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
73  bool isCXX(ID Id);
74 
75  /// Is this LLVM IR.
76  bool isLLVMIR(ID Id);
77 
78  /// isCuda - Is this a CUDA input.
79  bool isCuda(ID Id);
80 
81  /// isHIP - Is this a HIP input.
82  bool isHIP(ID Id);
83 
84  /// isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
85  bool isObjC(ID Id);
86 
87  /// isSrcFile - Is this a source file, i.e. something that still has to be
88  /// preprocessed. The logic behind this is the same that decides if the first
89  /// compilation phase is a preprocessing one.
90  bool isSrcFile(ID Id);
91 
92  /// lookupTypeForExtension - Lookup the type to use for the file
93  /// extension \p Ext.
94  ID lookupTypeForExtension(llvm::StringRef Ext);
95 
96  /// lookupTypeForTypSpecifier - Lookup the type to use for a user
97  /// specified type name.
98  ID lookupTypeForTypeSpecifier(const char *Name);
99 
100  /// getCompilationPhases - Get the list of compilation phases ('Phases') to be
101  /// done for type 'Id'.
103  ID Id,
106  llvm::opt::DerivedArgList &DAL, ID Id,
108 
109  /// lookupCXXTypeForCType - Lookup CXX input type that corresponds to given
110  /// C type (used for clang++ emulation of g++ behaviour)
112 
113  /// Lookup header file input type that corresponds to given
114  /// source file type (used for clang-cl emulation of \Yc).
116 
117 } // end namespace types
118 } // end namespace driver
119 } // end namespace clang
120 
121 #endif
Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be placed into a PointerUnion...
Definition: Dominators.h:30
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:112
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:67
bool onlyAssembleType(ID Id)
onlyAssembleType - Should this type only be assembled.
Definition: Types.cpp:84
bool canTypeBeUserSpecified(ID Id)
canTypeBeUserSpecified - Can this type be specified on the command line (by the type name); this is u...
Definition: Types.cpp:95
ID lookupCXXTypeForCType(ID Id)
lookupCXXTypeForCType - Lookup CXX input type that corresponds to given C type (used for clang++ emul...
Definition: Types.cpp:366
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:59
bool isHIP(ID Id)
isHIP - Is this a HIP input.
Definition: Types.cpp:203
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:47
ID lookupHeaderTypeForSourceType(ID Id)
Lookup header file input type that corresponds to given source file type (used for clang-cl emulation...
Definition: Types.cpp:382
const char * getTypeName(ID Id)
getTypeName - Return the name of the type for Id.
Definition: Types.cpp:43
int Id
Definition: ASTDiff.cpp:190
bool isCuda(ID Id)
isCuda - Is this a CUDA input.
Definition: Types.cpp:191
bool isAcceptedByClang(ID Id)
isAcceptedByClang - Can clang handle this input type.
Definition: Types.cpp:119
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:59
bool isCXX(ID Id)
isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
Definition: Types.cpp:160
ID lookupTypeForExtension(llvm::StringRef Ext)
lookupTypeForExtension - Lookup the type to use for the file extension Ext.
Definition: Types.cpp:219
bool onlyPrecompileType(ID Id)
onlyPrecompileType - Should this type only be precompiled.
Definition: Types.cpp:90
void getCompilationPhases(const clang::driver::Driver &Driver, llvm::opt::DerivedArgList &DAL, ID Id, llvm::SmallVectorImpl< phases::ID > &Phases)
Definition: Types.cpp:301
bool appendSuffixForType(ID Id)
appendSuffixForType - When generating outputs of this type, should the suffix be appended (instead of...
Definition: Types.cpp:107
ID lookupTypeForTypeSpecifier(const char *Name)
lookupTypeForTypSpecifier - Lookup the type to use for a user specified type name.
Definition: Types.cpp:281
bool isLLVMIR(ID Id)
Is this LLVM IR.
Definition: Types.cpp:178
bool isSrcFile(ID Id)
isSrcFile - Is this a source file, i.e.
Definition: Types.cpp:215
bool isObjC(ID Id)
isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
Definition: Types.cpp:147