clang  10.0.0svn
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. More...
 
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. More...
 
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. More...
 
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. More...
 
bool onlyAssembleType (ID Id)
 onlyAssembleType - Should this type only be assembled. More...
 
bool onlyPrecompileType (ID Id)
 onlyPrecompileType - Should this type only be precompiled. More...
 
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. More...
 
bool appendSuffixForType (ID Id)
 appendSuffixForType - When generating outputs of this type, should the suffix be appended (instead of replacing the existing suffix). More...
 
bool canLipoType (ID Id)
 canLipoType - Is this type acceptable as the output of a universal build (currently, just the Nothing, Image, and Object types). More...
 
bool isAcceptedByClang (ID Id)
 isAcceptedByClang - Can clang handle this input type. More...
 
bool isCXX (ID Id)
 isCXX - Is this a "C++" input (C++ and Obj-C++ sources and headers). More...
 
bool isLLVMIR (ID Id)
 Is this LLVM IR. More...
 
bool isCuda (ID Id)
 isCuda - Is this a CUDA input. More...
 
bool isHIP (ID Id)
 isHIP - Is this a HIP input. More...
 
bool isObjC (ID Id)
 isObjC - Is this an "ObjC" input (Obj-C and Obj-C++ sources and headers). More...
 
bool isSrcFile (ID Id)
 isSrcFile - Is this a source file, i.e. More...
 
ID lookupTypeForExtension (llvm::StringRef Ext)
 lookupTypeForExtension - Lookup the type to use for the file extension Ext. More...
 
ID lookupTypeForTypeSpecifier (const char *Name)
 lookupTypeForTypSpecifier - Lookup the type to use for a user specified type name. More...
 
void getCompilationPhases (ID Id, llvm::SmallVectorImpl< phases::ID > &Phases)
 getCompilationPhases - Get the list of compilation phases ('Phases') to be done for type 'Id'. More...
 
void getCompilationPhases (const clang::driver::Driver &Driver, llvm::opt::DerivedArgList &DAL, ID Id, llvm::SmallVectorImpl< phases::ID > &Phases)
 
ID lookupCXXTypeForCType (ID Id)
 lookupCXXTypeForCType - Lookup CXX input type that corresponds to given C type (used for clang++ emulation of g++ behaviour) More...
 
ID lookupHeaderTypeForSourceType (ID Id)
 Lookup header file input type that corresponds to given source file type (used for clang-cl emulation of ). More...
 

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 107 of file Types.cpp.

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 112 of file Types.cpp.

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 95 of file Types.cpp.

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

◆ getCompilationPhases() [1/2]

void clang::driver::types::getCompilationPhases ( ID  Id,
llvm::SmallVectorImpl< phases::ID > &  Phases 
)

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

Definition at line 295 of file Types.cpp.

References getInfo(), clang::driver::phases::MaxNumberOfPhases, and TypeInfo::Phases.

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

◆ getCompilationPhases() [2/2]

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

◆ 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 59 of file Types.cpp.

References isPrepeocessedModuleType(), onlyPrecompileType(), and TY_INVALID.

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

◆ 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 47 of file Types.cpp.

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

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

◆ getTypeName()

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

◆ getTypeTempSuffix()

const char * clang::driver::types::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 at line 67 of file Types.cpp.

References getInfo(), and TypeInfo::TempSuffix.

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

◆ isAcceptedByClang()

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

isAcceptedByClang - Can clang handle this input type.

Definition at line 119 of file Types.cpp.

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

◆ isCuda()

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

isCuda - Is this a CUDA input.

Definition at line 191 of file Types.cpp.

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

◆ isCXX()

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

◆ isHIP()

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

isHIP - Is this a HIP input.

Definition at line 203 of file Types.cpp.

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

◆ 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 147 of file Types.cpp.

Referenced by addExceptionArgs(), and RenderObjCOptions().

◆ 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 215 of file Types.cpp.

References getPreprocessedType(), and TY_INVALID.

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

◆ 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 366 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 ).

Definition at line 382 of file Types.cpp.

References Id.

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

◆ lookupTypeForExtension()

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

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

Definition at line 219 of file Types.cpp.

References TY_INVALID.

Referenced by clang::driver::Driver::BuildInputs(), clang::driver::toolchains::MachO::LookupTypeForExtension(), 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 281 of file Types.cpp.

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

◆ onlyAssembleType()

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

onlyAssembleType - Should this type only be assembled.

Definition at line 84 of file Types.cpp.

References clang::driver::phases::Assemble, clang::driver::phases::Backend, clang::driver::phases::Compile, and getInfo().

◆ onlyPrecompileType()

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

onlyPrecompileType - Should this type only be precompiled.

Definition at line 90 of file Types.cpp.

References getInfo(), isPrepeocessedModuleType(), and clang::driver::phases::Precompile.

Referenced by getPrecompiledType().