clang 19.0.0git
Enumerations | Functions
clang::driver::types Namespace Reference

Enumerations

enum  ID { TY_INVALID , TY_LAST }
 

Functions

const char * getTypeName (ID Id)
 getTypeName - Return the name of the type for Id.
 
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.
 
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.
 
const char * getTypeTempSuffix (ID Id, bool CLStyle=false)
 getTypeTempSuffix - Return the suffix to use when creating a temp file of this type, or null if unspecified.
 
bool onlyPrecompileType (ID Id)
 onlyPrecompileType - Should this type only be precompiled.
 
bool canTypeBeUserSpecified (ID Id)
 canTypeBeUserSpecified - Can this type be specified on the command line (by the type name); this is used when forwarding commands to gcc.
 
bool appendSuffixForType (ID Id)
 appendSuffixForType - When generating outputs of this type, should the suffix be appended (instead of replacing the existing suffix).
 
bool canLipoType (ID Id)
 canLipoType - Is this type acceptable as the output of a universal build (currently, just the Nothing, Image, and Object types).
 
bool isAcceptedByClang (ID Id)
 isAcceptedByClang - Can clang handle this input type.
 
bool isAcceptedByFlang (ID Id)
 isAcceptedByFlang - Can flang handle this input type.
 
bool isDerivedFromC (ID Id)
 isDerivedFromC - Is the input derived from C.
 
bool isCXX (ID Id)
 isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).
 
bool isLLVMIR (ID Id)
 Is this LLVM IR.
 
bool isCuda (ID Id)
 isCuda - Is this a CUDA input.
 
bool isHIP (ID Id)
 isHIP - Is this a HIP input.
 
bool isObjC (ID Id)
 isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).
 
bool isOpenCL (ID Id)
 isOpenCL - Is this an "OpenCL" input.
 
bool isHLSL (ID Id)
 isHLSL - Is this an HLSL input.
 
bool isSrcFile (ID Id)
 isSrcFile - Is this a source file, i.e.
 
ID lookupTypeForExtension (llvm::StringRef Ext)
 lookupTypeForExtension - Lookup the type to use for the file extension Ext.
 
ID lookupTypeForTypeSpecifier (const char *Name)
 lookupTypeForTypSpecifier - Lookup the type to use for a user specified type name.
 
llvm::SmallVector< phases::ID, phases::MaxNumberOfPhasesgetCompilationPhases (ID Id, phases::ID LastPhase=phases::IfsMerge)
 getCompilationPhases - Get the list of compilation phases ('Phases') to be done for type 'Id' up until including LastPhase.
 
llvm::SmallVector< phases::ID, phases::MaxNumberOfPhasesgetCompilationPhases (const clang::driver::Driver &Driver, llvm::opt::DerivedArgList &DAL, ID Id)
 
ID lookupCXXTypeForCType (ID Id)
 lookupCXXTypeForCType - Lookup CXX input type that corresponds to given C type (used for clang++ emulation of g++ behaviour)
 
ID lookupHeaderTypeForSourceType (ID Id)
 Lookup header file input type that corresponds to given source file type (used for clang-cl emulation of \Yc).
 

Enumeration Type Documentation

◆ ID

Enumerator
TY_INVALID 
TY_LAST 

Definition at line 23 of file Types.h.

Function Documentation

◆ appendSuffixForType()

bool clang::driver::types::appendSuffixForType ( ID  Id)

appendSuffixForType - When generating outputs of this type, should the suffix be appended (instead of replacing the existing suffix).

Definition at line 117 of file Types.cpp.

References Id.

Referenced by clang::driver::Driver::GetNamedOutputPath().

◆ canLipoType()

bool clang::driver::types::canLipoType ( ID  Id)

canLipoType - Is this type acceptable as the output of a universal build (currently, just the Nothing, Image, and Object types).

Definition at line 122 of file Types.cpp.

References Id.

Referenced by clang::driver::Driver::BuildUniversalActions().

◆ canTypeBeUserSpecified()

bool clang::driver::types::canTypeBeUserSpecified ( ID  Id)

canTypeBeUserSpecified - Can this type be specified on the command line (by the type name); this is used when forwarding commands to gcc.

Definition at line 105 of file Types.cpp.

References Id.

Referenced by clang::driver::tools::gcc::Common::ConstructJob(), and lookupTypeForTypeSpecifier().

◆ getCompilationPhases() [1/2]

llvm::SmallVector< phases::ID, phases::MaxNumberOfPhases > clang::driver::types::getCompilationPhases ( const clang::driver::Driver Driver,
llvm::opt::DerivedArgList &  DAL,
ID  Id 
)

Definition at line 397 of file Types.cpp.

References getCompilationPhases(), clang::driver::Driver::getFinalPhase(), and Id.

◆ getCompilationPhases() [2/2]

llvm::SmallVector< phases::ID, phases::MaxNumberOfPhases > clang::driver::types::getCompilationPhases ( ID  Id,
phases::ID  LastPhase = phases::IfsMerge 
)

getCompilationPhases - Get the list of compilation phases ('Phases') to be done for type 'Id' up until including LastPhase.

Definition at line 386 of file Types.cpp.

References getInfo(), Id, clang::driver::phases::MaxNumberOfPhases, and P.

Referenced by clang::driver::Driver::BuildActions(), clang::driver::Driver::BuildOffloadingActions(), and getCompilationPhases().

◆ getPrecompiledType()

types::ID clang::driver::types::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 at line 73 of file Types.cpp.

References Id, isPreprocessedHeaderUnitType(), isPreprocessedModuleType(), onlyPrecompileType(), and TY_INVALID.

◆ getPreprocessedType()

types::ID clang::driver::types::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 at line 56 of file Types.cpp.

References getInfo(), Id, clang::driver::phases::Preprocess, TypeInfo::PreprocessedType, and TY_INVALID.

Referenced by clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::Flang::ConstructJob(), clang::driver::Driver::ConstructPhaseAction(), clang::driver::Driver::generateCompilationDiagnostics(), and isSrcFile().

◆ getTypeName()

const char * clang::driver::types::getTypeName ( ID  Id)

getTypeName - Return the name of the type for Id.

Definition at line 52 of file Types.cpp.

References getInfo(), Id, and TypeInfo::Name.

Referenced by addDashXForInput(), clang::driver::Driver::BuildUniversalActions(), clang::driver::tools::Clang::ConstructJob(), and clang::driver::tools::gcc::Common::ConstructJob().

◆ getTypeTempSuffix()

const char * clang::driver::types::getTypeTempSuffix ( ID  Id,
bool  CLStyle = false 
)

getTypeTempSuffix - Return the suffix to use when creating a temp file of this type, or null if unspecified.

Definition at line 83 of file Types.cpp.

References getInfo(), Id, and TypeInfo::TempSuffix.

Referenced by clang::driver::tools::OffloadBundler::ConstructJob(), clang::driver::tools::OffloadBundler::ConstructJobMultipleOutputs(), clang::driver::Driver::GetNamedOutputPath(), and MakeCLOutputFilename().

◆ isAcceptedByClang()

bool clang::driver::types::isAcceptedByClang ( ID  Id)

isAcceptedByClang - Can clang handle this input type.

Definition at line 129 of file Types.cpp.

References Id.

Referenced by clang::driver::Driver::ShouldUseClangCompiler().

◆ isAcceptedByFlang()

bool clang::driver::types::isAcceptedByFlang ( ID  Id)

isAcceptedByFlang - Can flang handle this input type.

Definition at line 162 of file Types.cpp.

References Id.

Referenced by clang::driver::Driver::ShouldUseFlangCompiler().

◆ isCuda()

bool clang::driver::types::isCuda ( ID  Id)

isCuda - Is this a CUDA input.

Definition at line 268 of file Types.cpp.

References Id.

Referenced by clang::driver::Driver::BuildOffloadingActions(), and clang::driver::Driver::CreateOffloadingDeviceToolChains().

◆ isCXX()

bool clang::driver::types::isCXX ( ID  Id)

isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers).

Definition at line 232 of file Types.cpp.

References Id.

Referenced by clang::driver::SanitizerArgs::addArgs(), addExceptionArgs(), clang::driver::tools::Clang::ConstructJob(), RenderAnalyzerOptions(), RenderModulesOptions(), and RenderObjCOptions().

◆ isDerivedFromC()

bool clang::driver::types::isDerivedFromC ( ID  Id)

isDerivedFromC - Is the input derived from C.

That is, does the lexer follow the rules of TokenConcatenation::AvoidConcat. If this is the case, the preprocessor may add and remove whitespace between tokens. Used to determine whether the input can be processed by -fminimize-whitespace.

Definition at line 176 of file Types.cpp.

References Id.

◆ isHIP()

bool clang::driver::types::isHIP ( ID  Id)

isHIP - Is this a HIP input.

Definition at line 280 of file Types.cpp.

References Id.

Referenced by clang::driver::Driver::BuildOffloadingActions(), and clang::driver::Driver::CreateOffloadingDeviceToolChains().

◆ isHLSL()

bool clang::driver::types::isHLSL ( ID  Id)

isHLSL - Is this an HLSL input.

Definition at line 292 of file Types.cpp.

References Id.

Referenced by RenderHLSLOptions().

◆ isLLVMIR()

bool clang::driver::types::isLLVMIR ( ID  Id)

◆ isObjC()

bool clang::driver::types::isObjC ( ID  Id)

isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers).

Definition at line 217 of file Types.cpp.

References Id.

Referenced by addExceptionArgs(), clang::driver::tools::Clang::ConstructJob(), and RenderObjCOptions().

◆ isOpenCL()

bool clang::driver::types::isOpenCL ( ID  Id)

isOpenCL - Is this an "OpenCL" input.

Definition at line 230 of file Types.cpp.

References Id.

Referenced by clang::driver::tools::Clang::ConstructJob(), and RenderOpenCLOptions().

◆ isSrcFile()

bool clang::driver::types::isSrcFile ( ID  Id)

isSrcFile - Is this a source file, i.e.

something that still has to be preprocessed. The logic behind this is the same that decides if the first compilation phase is a preprocessing one.

Definition at line 294 of file Types.cpp.

References getPreprocessedType(), Id, and TY_INVALID.

Referenced by clang::driver::Driver::BuildOffloadingActions(), and RenderOpenCLOptions().

◆ lookupCXXTypeForCType()

ID clang::driver::types::lookupCXXTypeForCType ( ID  Id)

lookupCXXTypeForCType - Lookup CXX input type that corresponds to given C type (used for clang++ emulation of g++ behaviour)

Definition at line 402 of file Types.cpp.

References Id.

Referenced by clang::driver::Driver::BuildInputs().

◆ lookupHeaderTypeForSourceType()

ID clang::driver::types::lookupHeaderTypeForSourceType ( ID  Id)

Lookup header file input type that corresponds to given source file type (used for clang-cl emulation of \Yc).

Definition at line 418 of file Types.cpp.

References Id.

◆ lookupTypeForExtension()

types::ID clang::driver::types::lookupTypeForExtension ( llvm::StringRef  Ext)

lookupTypeForExtension - Lookup the type to use for the file extension Ext.

Definition at line 298 of file Types.cpp.

References TY_INVALID.

Referenced by clang::driver::tools::AddStaticDeviceLibs(), and clang::driver::ToolChain::LookupTypeForExtension().

◆ lookupTypeForTypeSpecifier()

types::ID clang::driver::types::lookupTypeForTypeSpecifier ( const char *  Name)

lookupTypeForTypSpecifier - Lookup the type to use for a user specified type name.

Definition at line 371 of file Types.cpp.

References canTypeBeUserSpecified(), getInfo(), Id, numTypes, and TY_INVALID.

Referenced by clang::driver::Driver::BuildInputs().

◆ onlyPrecompileType()

bool clang::driver::types::onlyPrecompileType ( ID  Id)

onlyPrecompileType - Should this type only be precompiled.

Definition at line 100 of file Types.cpp.

References TypeInfo::PhasesBitSet::contains(), getInfo(), Id, isPreprocessedModuleType(), TypeInfo::Phases, and clang::driver::phases::Precompile.

Referenced by getPrecompiledType().