clang  6.0.0svn
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clang::TargetInfo Class Referenceabstract

Exposes information about the current target. More...

#include "clang/Basic/TargetInfo.h"

Inheritance diagram for clang::TargetInfo:
Inheritance graph
[legend]
Collaboration diagram for clang::TargetInfo:
Collaboration graph
[legend]

Classes

struct  AddlRegName
 
struct  ConstraintInfo
 
struct  GCCRegAlias
 

Public Types

enum  IntType {
  NoInt = 0, SignedChar, UnsignedChar, SignedShort,
  UnsignedShort, SignedInt, UnsignedInt, SignedLong,
  UnsignedLong, SignedLongLong, UnsignedLongLong
}
 ===-— Target Data Type Query Methods ----------------------------—===// More...
 
enum  RealType {
  NoFloat = 255, Float = 0, Double, LongDouble,
  Float128
}
 
enum  BuiltinVaListKind {
  CharPtrBuiltinVaList = 0, VoidPtrBuiltinVaList, AArch64ABIBuiltinVaList, PNaClABIBuiltinVaList,
  PowerABIBuiltinVaList, X86_64ABIBuiltinVaList, AAPCSABIBuiltinVaList, SystemZBuiltinVaList
}
 The different kinds of __builtin_va_list types defined by the target implementation. More...
 
enum  CallingConvMethodType { CCMT_Unknown, CCMT_Member, CCMT_NonMember }
 
enum  CallingConvCheckResult { CCCR_OK, CCCR_Warning, CCCR_Ignore }
 

Public Member Functions

virtual ~TargetInfo ()
 
TargetOptionsgetTargetOpts () const
 Retrieve the target options. More...
 
IntType getSizeType () const
 
IntType getSignedSizeType () const
 
IntType getIntMaxType () const
 
IntType getUIntMaxType () const
 
IntType getPtrDiffType (unsigned AddrSpace) const
 
IntType getUnsignedPtrDiffType (unsigned AddrSpace) const
 
IntType getIntPtrType () const
 
IntType getUIntPtrType () const
 
IntType getWCharType () const
 
IntType getWIntType () const
 
IntType getChar16Type () const
 
IntType getChar32Type () const
 
IntType getInt64Type () const
 
IntType getUInt64Type () const
 
IntType getSigAtomicType () const
 
IntType getProcessIDType () const
 
unsigned getTypeWidth (IntType T) const
 Return the width (in bits) of the specified integer type enum. More...
 
virtual IntType getIntTypeByWidth (unsigned BitWidth, bool IsSigned) const
 Return integer type with specified width. More...
 
virtual IntType getLeastIntTypeByWidth (unsigned BitWidth, bool IsSigned) const
 Return the smallest integer type with at least the specified width. More...
 
RealType getRealTypeByWidth (unsigned BitWidth) const
 Return floating point type with specified width. More...
 
unsigned getTypeAlign (IntType T) const
 Return the alignment (in bits) of the specified integer type enum. More...
 
uint64_t getPointerWidth (unsigned AddrSpace) const
 Return the width of pointers on this target, for the specified address space. More...
 
uint64_t getPointerAlign (unsigned AddrSpace) const
 
virtual uint64_t getMaxPointerWidth () const
 Return the maximum width of pointers on this target. More...
 
virtual uint64_t getNullPointerValue (LangAS AddrSpace) const
 Get integer value for null pointer. More...
 
unsigned getBoolWidth () const
 Return the size of '_Bool' and C++ 'bool' for this target, in bits. More...
 
unsigned getBoolAlign () const
 Return the alignment of '_Bool' and C++ 'bool' for this target. More...
 
unsigned getCharWidth () const
 
unsigned getCharAlign () const
 
unsigned getShortWidth () const
 Return the size of 'signed short' and 'unsigned short' for this target, in bits. More...
 
unsigned getShortAlign () const
 Return the alignment of 'signed short' and 'unsigned short' for this target. More...
 
unsigned getIntWidth () const
 getIntWidth/Align - Return the size of 'signed int' and 'unsigned int' for this target, in bits. More...
 
unsigned getIntAlign () const
 
unsigned getLongWidth () const
 getLongWidth/Align - Return the size of 'signed long' and 'unsigned long' for this target, in bits. More...
 
unsigned getLongAlign () const
 
unsigned getLongLongWidth () const
 getLongLongWidth/Align - Return the size of 'signed long long' and 'unsigned long long' for this target, in bits. More...
 
unsigned getLongLongAlign () const
 
virtual bool hasInt128Type () const
 Determine whether the __int128 type is supported on this target. More...
 
virtual bool hasFloat128Type () const
 Determine whether the __float128 type is supported on this target. More...
 
unsigned getSuitableAlign () const
 Return the alignment that is suitable for storing any object with a fundamental alignment requirement. More...
 
unsigned getDefaultAlignForAttributeAligned () const
 Return the default alignment for attribute((aligned)) on this target, to be used if no alignment value is specified. More...
 
unsigned getMinGlobalAlign () const
 getMinGlobalAlign - Return the minimum alignment of a global variable, unless its alignment is explicitly reduced via attributes. More...
 
unsigned getNewAlign () const
 Return the largest alignment for which a suitably-sized allocation with '::operator new(size_t)' is guaranteed to produce a correctly-aligned pointer. More...
 
unsigned getWCharWidth () const
 getWCharWidth/Align - Return the size of 'wchar_t' for this target, in bits. More...
 
unsigned getWCharAlign () const
 
unsigned getChar16Width () const
 getChar16Width/Align - Return the size of 'char16_t' for this target, in bits. More...
 
unsigned getChar16Align () const
 
unsigned getChar32Width () const
 getChar32Width/Align - Return the size of 'char32_t' for this target, in bits. More...
 
unsigned getChar32Align () const
 
unsigned getHalfWidth () const
 getHalfWidth/Align/Format - Return the size/align/format of 'half'. More...
 
unsigned getHalfAlign () const
 
const llvm::fltSemantics & getHalfFormat () const
 
unsigned getFloatWidth () const
 getFloatWidth/Align/Format - Return the size/align/format of 'float'. More...
 
unsigned getFloatAlign () const
 
const llvm::fltSemantics & getFloatFormat () const
 
unsigned getDoubleWidth () const
 getDoubleWidth/Align/Format - Return the size/align/format of 'double'. More...
 
unsigned getDoubleAlign () const
 
const llvm::fltSemantics & getDoubleFormat () const
 
unsigned getLongDoubleWidth () const
 getLongDoubleWidth/Align/Format - Return the size/align/format of 'long double'. More...
 
unsigned getLongDoubleAlign () const
 
const llvm::fltSemantics & getLongDoubleFormat () const
 
unsigned getFloat128Width () const
 getFloat128Width/Align/Format - Return the size/align/format of '__float128'. More...
 
unsigned getFloat128Align () const
 
const llvm::fltSemantics & getFloat128Format () const
 
virtual bool useFloat128ManglingForLongDouble () const
 Return true if the 'long double' type should be mangled like __float128. More...
 
virtual unsigned getFloatEvalMethod () const
 Return the value for the C99 FLT_EVAL_METHOD macro. More...
 
unsigned getLargeArrayMinWidth () const
 
unsigned getLargeArrayAlign () const
 
unsigned getMaxAtomicPromoteWidth () const
 Return the maximum width lock-free atomic operation which will ever be supported for the given target. More...
 
unsigned getMaxAtomicInlineWidth () const
 Return the maximum width lock-free atomic operation which can be inlined given the supported features of the given target. More...
 
virtual void setMaxAtomicWidth ()
 Set the maximum inline or promote width lock-free atomic operation for the given target. More...
 
virtual bool hasBuiltinAtomic (uint64_t AtomicSizeInBits, uint64_t AlignmentInBits) const
 Returns true if the given target supports lock-free atomic operations at the specified width and alignment. More...
 
unsigned getMaxVectorAlign () const
 Return the maximum vector alignment supported for the given target. More...
 
unsigned getSimdDefaultAlign () const
 Return default simd alignment for the given target. More...
 
unsigned getIntMaxTWidth () const
 Return the size of intmax_t and uintmax_t for this target, in bits. More...
 
virtual unsigned getUnwindWordWidth () const
 
virtual unsigned getRegisterWidth () const
 Return the "preferred" register width on this target. More...
 
const char * getMCountName () const
 Returns the name of the mcount instrumentation function. More...
 
bool useSignedCharForObjCBool () const
 Check if the Objective-C built-in boolean type should be signed char. More...
 
void noSignedCharForObjCBool ()
 
bool useBitFieldTypeAlignment () const
 Check whether the alignment of bit-field types is respected when laying out structures. More...
 
bool useZeroLengthBitfieldAlignment () const
 Check whether zero length bitfields should force alignment of the next member. More...
 
unsigned getZeroLengthBitfieldBoundary () const
 Get the fixed alignment value in bits for a member that follows a zero length bitfield. More...
 
bool useExplicitBitFieldAlignment () const
 Check whether explicit bitfield alignment attributes should be. More...
 
bool hasAlignMac68kSupport () const
 Check whether this target support '#pragma options align=mac68k'. More...
 
const char * getTypeConstantSuffix (IntType T) const
 Return the constant suffix for the specified integer type enum. More...
 
bool useObjCFPRetForRealType (RealType T) const
 Check whether the given real type should use the "fpret" flavor of Objective-C message passing on this target. More...
 
bool useObjCFP2RetForComplexLongDouble () const
 Check whether _Complex long double should use the "fp2ret" flavor of Objective-C message passing on this target. More...
 
bool useAddressSpaceMapMangling () const
 Specify if mangling based on address space map should be used or not for language specific address spaces. More...
 
virtual void getTargetDefines (const LangOptions &Opts, MacroBuilder &Builder) const =0
 ===-— Other target property query methods --------------------——===// More...
 
virtual ArrayRef< Builtin::InfogetTargetBuiltins () const =0
 Return information about target-specific builtins for the current primary target, and info about which builtins are non-portable across the current set of primary and secondary targets. More...
 
virtual bool isCLZForZeroUndef () const
 The __builtin_clz* and __builtin_ctz* built-in functions are specified to have undefined results for zero inputs, but on targets that support these operations in a way that provides well-defined results for zero without loss of performance, it is a good idea to avoid optimizing based on that undef behavior. More...
 
virtual BuiltinVaListKind getBuiltinVaListKind () const =0
 Returns the kind of __builtin_va_list type that should be used with this target. More...
 
bool hasBuiltinMSVaList () const
 Returns whether or not type __builtin_ms_va_list type is available on this target. More...
 
bool isRenderScriptTarget () const
 Returns true for RenderScript. More...
 
bool isValidClobber (StringRef Name) const
 Returns whether the passed in string is a valid clobber in an inline asm statement. More...
 
bool isValidGCCRegisterName (StringRef Name) const
 Returns whether the passed in string is a valid register name according to GCC. More...
 
StringRef getNormalizedGCCRegisterName (StringRef Name, bool ReturnCanonical=false) const
 Returns the "normalized" GCC register name. More...
 
virtual StringRef getConstraintRegister (const StringRef &Constraint, const StringRef &Expression) const
 
virtual bool validateGlobalRegisterVariable (StringRef RegName, unsigned RegSize, bool &HasSizeMismatch) const
 Validate register name used for global register variables. More...
 
bool validateOutputConstraint (ConstraintInfo &Info) const
 
bool validateInputConstraint (MutableArrayRef< ConstraintInfo > OutputConstraints, ConstraintInfo &info) const
 
virtual bool validateOutputSize (StringRef, unsigned) const
 
virtual bool validateInputSize (StringRef, unsigned) const
 
virtual bool validateConstraintModifier (StringRef, char, unsigned, std::string &) const
 
virtual bool validateAsmConstraint (const char *&Name, TargetInfo::ConstraintInfo &info) const =0
 
bool resolveSymbolicName (const char *&Name, ArrayRef< ConstraintInfo > OutputConstraints, unsigned &Index) const
 
virtual std::string convertConstraint (const char *&Constraint) const
 
virtual const char * getClobbers () const =0
 Returns a string of target-specific clobbers, in LLVM format. More...
 
virtual bool isNan2008 () const
 Returns true if NaN encoding is IEEE 754-2008. More...
 
const llvm::Triple & getTriple () const
 Returns the target triple of the primary target. More...
 
const llvm::DataLayout & getDataLayout () const
 
virtual bool hasProtectedVisibility () const
 Does this target support "protected" visibility? More...
 
virtual std::string isValidSectionSpecifier (StringRef SR) const
 An optional hook that targets can implement to perform semantic checking on attribute((section("foo"))) specifiers. More...
 
virtual void adjust (LangOptions &Opts)
 Set forced language options. More...
 
virtual void adjustTargetOptions (const CodeGenOptions &CGOpts, TargetOptions &TargetOpts) const
 Adjust target options based on codegen options. More...
 
virtual bool initFeatureMap (llvm::StringMap< bool > &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector< std::string > &FeatureVec) const
 Initialize the map with the default set of target features for the CPU this should include all legal feature strings on the target. More...
 
virtual StringRef getABI () const
 Get the ABI currently in use. More...
 
TargetCXXABI getCXXABI () const
 Get the C++ ABI currently in use. More...
 
virtual bool setCPU (const std::string &Name)
 Target the specified CPU. More...
 
virtual bool isValidCPUName (StringRef Name) const
 brief Determine whether this TargetInfo supports the given CPU name. More...
 
virtual bool setABI (const std::string &Name)
 Use the specified ABI. More...
 
virtual bool setFPMath (StringRef Name)
 Use the specified unit for FP math. More...
 
virtual void setFeatureEnabled (llvm::StringMap< bool > &Features, StringRef Name, bool Enabled) const
 Enable or disable a specific target feature; the feature name must be valid. More...
 
virtual bool isValidFeatureName (StringRef Feature) const
 Determine whether this TargetInfo supports the given feature. More...
 
virtual bool handleTargetFeatures (std::vector< std::string > &Features, DiagnosticsEngine &Diags)
 Perform initialization based on the user configured set of features (e.g., +sse4). More...
 
virtual bool hasFeature (StringRef Feature) const
 Determine whether the given target has the given feature. More...
 
virtual bool validateCpuSupports (StringRef Name) const
 
virtual bool validateCpuIs (StringRef Name) const
 
unsigned getRegParmMax () const
 
bool isTLSSupported () const
 Whether the target supports thread-local storage. More...
 
unsigned short getMaxTLSAlign () const
 Return the maximum alignment (in bits) of a TLS variable. More...
 
bool isSEHTrySupported () const
 Whether the target supports SEH __try. More...
 
bool hasNoAsmVariants () const
 Return true if {|} are normal characters in the asm string. More...
 
virtual int getEHDataRegisterNumber (unsigned RegNo) const
 Return the register number that __builtin_eh_return_regno would return with the specified argument. More...
 
virtual const char * getStaticInitSectionSpecifier () const
 Return the section to use for C++ static initialization functions. More...
 
const LangASMapgetAddressSpaceMap () const
 
virtual llvm::Optional< LangASgetConstantAddressSpace () const
 Return an AST address space which can be used opportunistically for constant global memory. More...
 
StringRef getPlatformName () const
 Retrieve the name of the platform as it is used in the availability attribute. More...
 
VersionTuple getPlatformMinVersion () const
 Retrieve the minimum desired version of the platform, to which the program should be compiled. More...
 
bool isBigEndian () const
 
bool isLittleEndian () const
 
virtual CallingConv getDefaultCallingConv (CallingConvMethodType MT) const
 Gets the default calling convention for the given target and declaration context. More...
 
virtual CallingConvCheckResult checkCallingConvention (CallingConv CC) const
 Determines whether a given calling convention is valid for the target. More...
 
virtual bool hasSjLjLowering () const
 Controls if __builtin_longjmp / __builtin_setjmp can be lowered to llvm.eh.sjlj.longjmp / llvm.eh.sjlj.setjmp. More...
 
virtual bool allowsLargerPreferedTypeAlignment () const
 Whether target allows to overalign ABI-specified preferred alignment. More...
 
virtual void setSupportedOpenCLOpts ()
 Set supported OpenCL extensions and optional core features. More...
 
virtual void setOpenCLExtensionOpts ()
 Set supported OpenCL extensions as written on command line. More...
 
OpenCLOptionsgetSupportedOpenCLOpts ()
 Get supported OpenCL extensions and optional core features. More...
 
const OpenCLOptionsgetSupportedOpenCLOpts () const
 Get const supported OpenCL extensions and optional core features. More...
 
virtual LangAS getOpenCLTypeAddrSpace (const Type *T) const
 Get address space for OpenCL type. More...
 
virtual unsigned getVtblPtrAddressSpace () const
 
virtual Optional< unsigned > getDWARFAddressSpace (unsigned AddressSpace) const
 
virtual bool validateTarget (DiagnosticsEngine &Diags) const
 Check the target is valid after it is fully initialized. More...
 

Static Public Member Functions

static TargetInfoCreateTargetInfo (DiagnosticsEngine &Diags, const std::shared_ptr< TargetOptions > &Opts)
 Construct a target for the given options. More...
 
static IntType getCorrespondingUnsignedType (IntType T)
 
static bool isTypeSigned (IntType T)
 Returns true if the type is signed; false otherwise. More...
 
static const char * getTypeName (IntType T)
 Return the user string for the specified integer type enum. More...
 
static const char * getTypeFormatModifier (IntType T)
 Return the printf format modifier for the specified integer type enum. More...
 

Protected Member Functions

 TargetInfo (const llvm::Triple &T)
 
void resetDataLayout (StringRef DL)
 
virtual uint64_t getPointerWidthV (unsigned AddrSpace) const
 
virtual uint64_t getPointerAlignV (unsigned AddrSpace) const
 
virtual enum IntType getPtrDiffTypeV (unsigned AddrSpace) const
 
virtual ArrayRef< const char * > getGCCRegNames () const =0
 
virtual ArrayRef< GCCRegAliasgetGCCRegAliases () const =0
 
virtual ArrayRef< AddlRegNamegetGCCAddlRegNames () const
 

Protected Attributes

bool BigEndian
 
bool TLSSupported
 
bool NoAsmVariants
 
bool HasFloat128
 
unsigned char PointerWidth
 
unsigned char PointerAlign
 
unsigned char BoolWidth
 
unsigned char BoolAlign
 
unsigned char IntWidth
 
unsigned char IntAlign
 
unsigned char HalfWidth
 
unsigned char HalfAlign
 
unsigned char FloatWidth
 
unsigned char FloatAlign
 
unsigned char DoubleWidth
 
unsigned char DoubleAlign
 
unsigned char LongDoubleWidth
 
unsigned char LongDoubleAlign
 
unsigned char Float128Align
 
unsigned char LargeArrayMinWidth
 
unsigned char LargeArrayAlign
 
unsigned char LongWidth
 
unsigned char LongAlign
 
unsigned char LongLongWidth
 
unsigned char LongLongAlign
 
unsigned char SuitableAlign
 
unsigned char DefaultAlignForAttributeAligned
 
unsigned char MinGlobalAlign
 
unsigned char MaxAtomicPromoteWidth
 
unsigned char MaxAtomicInlineWidth
 
unsigned short MaxVectorAlign
 
unsigned short MaxTLSAlign
 
unsigned short SimdDefaultAlign
 
unsigned short NewAlign
 
std::unique_ptr< llvm::DataLayout > DataLayout
 
const char * MCountName
 
const llvm::fltSemantics * HalfFormat
 
const llvm::fltSemantics * FloatFormat
 
const llvm::fltSemantics * DoubleFormat
 
const llvm::fltSemantics * LongDoubleFormat
 
const llvm::fltSemantics * Float128Format
 
unsigned char RegParmMax
 
unsigned char SSERegParmMax
 
TargetCXXABI TheCXXABI
 
const LangASMapAddrSpaceMap
 
StringRef PlatformName
 
VersionTuple PlatformMinVersion
 
unsigned HasAlignMac68kSupport: 1
 
unsigned RealTypeUsesObjCFPRet: 3
 
unsigned ComplexLongDoubleUsesFP2Ret: 1
 
unsigned HasBuiltinMSVaList: 1
 
unsigned IsRenderScriptTarget: 1
 
IntType SizeType
 
IntType IntMaxType
 
IntType PtrDiffType
 
IntType IntPtrType
 
IntType WCharType
 
IntType WIntType
 
IntType Char16Type
 
IntType Char32Type
 
IntType Int64Type
 
IntType SigAtomicType
 
IntType ProcessIDType
 
unsigned UseSignedCharForObjCBool: 1
 Whether Objective-C's built-in boolean type should be signed char. More...
 
unsigned UseBitFieldTypeAlignment: 1
 Control whether the alignment of bit-field types is respected when laying out structures. More...
 
unsigned UseZeroLengthBitfieldAlignment: 1
 Whether zero length bitfields (e.g., int : 0;) force alignment of the next bitfield. More...
 
unsigned UseExplicitBitFieldAlignment: 1
 Whether explicit bit field alignment attributes are honored. More...
 
unsigned ZeroLengthBitfieldBoundary
 If non-zero, specifies a fixed alignment value for bitfields that follow zero length bitfield, regardless of the zero length bitfield type. More...
 
bool UseAddrSpaceMapMangling
 Specify if mangling based on address space map should be used or not for language specific address spaces. More...
 

Detailed Description

Exposes information about the current target.

Definition at line 55 of file TargetInfo.h.

Member Enumeration Documentation

◆ BuiltinVaListKind

The different kinds of __builtin_va_list types defined by the target implementation.

Enumerator
CharPtrBuiltinVaList 

typedef char* __builtin_va_list;

VoidPtrBuiltinVaList 

typedef void* __builtin_va_list;

AArch64ABIBuiltinVaList 

__builtin_va_list as defined by the AArch64 ABI http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055a/IHI0055A_aapcs64.pdf

PNaClABIBuiltinVaList 

__builtin_va_list as defined by the PNaCl ABI: http://www.chromium.org/nativeclient/pnacl/bitcode-abi#TOC-Machine-Types

PowerABIBuiltinVaList 

__builtin_va_list as defined by the Power ABI: https://www.power.org /resources/downloads/Power-Arch-32-bit-ABI-supp-1.0-Embedded.pdf

X86_64ABIBuiltinVaList 

__builtin_va_list as defined by the x86-64 ABI: http://refspecs.linuxbase.org/elf/x86_64-abi-0.21.pdf

AAPCSABIBuiltinVaList 

__builtin_va_list as defined by ARM AAPCS ABI http://infocenter.arm.com

SystemZBuiltinVaList 

Definition at line 152 of file TargetInfo.h.

◆ CallingConvCheckResult

Enumerator
CCCR_OK 
CCCR_Warning 
CCCR_Ignore 

Definition at line 1008 of file TargetInfo.h.

◆ CallingConvMethodType

Enumerator
CCMT_Unknown 
CCMT_Member 
CCMT_NonMember 

Definition at line 993 of file TargetInfo.h.

◆ IntType

===-— Target Data Type Query Methods ----------------------------—===//

Enumerator
NoInt 
SignedChar 
UnsignedChar 
SignedShort 
UnsignedShort 
SignedInt 
UnsignedInt 
SignedLong 
UnsignedLong 
SignedLongLong 
UnsignedLongLong 

Definition at line 128 of file TargetInfo.h.

◆ RealType

Enumerator
NoFloat 
Float 
Double 
LongDouble 
Float128 

Definition at line 142 of file TargetInfo.h.

Constructor & Destructor Documentation

◆ TargetInfo()

TargetInfo::TargetInfo ( const llvm::Triple &  T)
protected

◆ ~TargetInfo()

TargetInfo::~TargetInfo ( )
virtual

Definition at line 115 of file TargetInfo.cpp.

Member Function Documentation

◆ adjust()

void TargetInfo::adjust ( LangOptions Opts)
virtual

◆ adjustTargetOptions()

virtual void clang::TargetInfo::adjustTargetOptions ( const CodeGenOptions CGOpts,
TargetOptions TargetOpts 
) const
inlinevirtual

Adjust target options based on codegen options.

Reimplemented in clang::targets::AMDGPUTargetInfo.

Definition at line 836 of file TargetInfo.h.

Referenced by clang::CompilerInstance::ExecuteAction().

◆ allowsLargerPreferedTypeAlignment()

virtual bool clang::TargetInfo::allowsLargerPreferedTypeAlignment ( ) const
inlinevirtual

Whether target allows to overalign ABI-specified preferred alignment.

Reimplemented in clang::targets::MCUX86_32TargetInfo, and clang::targets::XCoreTargetInfo.

Definition at line 1034 of file TargetInfo.h.

Referenced by clang::ASTContext::getPreferredTypeAlign().

◆ checkCallingConvention()

virtual CallingConvCheckResult clang::TargetInfo::checkCallingConvention ( CallingConv  CC) const
inlinevirtual

Determines whether a given calling convention is valid for the target.

A calling convention can either be accepted, produce a warning and be substituted with the default calling convention, or (someday) produce an error (such as using thiscall on a non-instance function).

Reimplemented in clang::targets::WindowsX86_64TargetInfo, clang::targets::X86_64TargetInfo, clang::targets::MCUX86_32TargetInfo, clang::targets::X86TargetInfo, clang::targets::AMDGPUTargetInfo, clang::targets::WindowsARMTargetInfo, clang::targets::ARMTargetInfo, clang::targets::SystemZTargetInfo, clang::targets::NVPTXTargetInfo, clang::targets::WindowsARM64TargetInfo, clang::targets::SPIRTargetInfo, clang::targets::BPFTargetInfo, and clang::targets::AArch64TargetInfo.

Definition at line 1018 of file TargetInfo.h.

References clang::CC_C.

◆ convertConstraint()

virtual std::string clang::TargetInfo::convertConstraint ( const char *&  Constraint) const
inlinevirtual

◆ CreateTargetInfo()

TargetInfo * TargetInfo::CreateTargetInfo ( DiagnosticsEngine Diags,
const std::shared_ptr< TargetOptions > &  Opts 
)
static

Construct a target for the given options.

CreateTargetInfo - Return the target info object for the specified target options.

Parameters
Opts- The options to use to initialize the target. The target may modify the options to canonicalize the target feature information to match what the backend expects.

Definition at line 576 of file Targets.cpp.

References clang::targets::AllocateTarget(), and clang::DiagnosticsEngine::Report().

Referenced by clang::PrecompiledPreamble::Build(), clang::ASTUnit::CodeComplete(), clang::createChainedIncludesSource(), createVFSOverlayForPreamblePCH(), and clang::CompilerInstance::ExecuteAction().

◆ getABI()

virtual StringRef clang::TargetInfo::getABI ( ) const
inlinevirtual

◆ getAddressSpaceMap()

const LangASMap& clang::TargetInfo::getAddressSpaceMap ( ) const
inline

Definition at line 972 of file TargetInfo.h.

Referenced by getAddressSpaceMap().

◆ getBoolAlign()

unsigned clang::TargetInfo::getBoolAlign ( ) const
inline

Return the alignment of '_Bool' and C++ 'bool' for this target.

Definition at line 331 of file TargetInfo.h.

◆ getBoolWidth()

unsigned clang::TargetInfo::getBoolWidth ( ) const
inline

Return the size of '_Bool' and C++ 'bool' for this target, in bits.

Definition at line 328 of file TargetInfo.h.

◆ getBuiltinVaListKind()

virtual BuiltinVaListKind clang::TargetInfo::getBuiltinVaListKind ( ) const
pure virtual

◆ getChar16Align()

unsigned clang::TargetInfo::getChar16Align ( ) const
inline

Definition at line 396 of file TargetInfo.h.

◆ getChar16Type()

IntType clang::TargetInfo::getChar16Type ( ) const
inline

Definition at line 260 of file TargetInfo.h.

◆ getChar16Width()

unsigned clang::TargetInfo::getChar16Width ( ) const
inline

getChar16Width/Align - Return the size of 'char16_t' for this target, in bits.

Definition at line 395 of file TargetInfo.h.

Referenced by EvaluateValue(), getCharWidth(), and clang::FloatingLiteral::getValueAsApproximateDouble().

◆ getChar32Align()

unsigned clang::TargetInfo::getChar32Align ( ) const
inline

Definition at line 401 of file TargetInfo.h.

◆ getChar32Type()

IntType clang::TargetInfo::getChar32Type ( ) const
inline

Definition at line 261 of file TargetInfo.h.

◆ getChar32Width()

unsigned clang::TargetInfo::getChar32Width ( ) const
inline

getChar32Width/Align - Return the size of 'char32_t' for this target, in bits.

Definition at line 400 of file TargetInfo.h.

Referenced by EvaluateValue(), getCharWidth(), and clang::FloatingLiteral::getValueAsApproximateDouble().

◆ getCharAlign()

unsigned clang::TargetInfo::getCharAlign ( ) const
inline

◆ getCharWidth()

unsigned clang::TargetInfo::getCharWidth ( ) const
inline

◆ getClobbers()

virtual const char* clang::TargetInfo::getClobbers ( ) const
pure virtual

◆ getConstantAddressSpace()

virtual llvm::Optional<LangAS> clang::TargetInfo::getConstantAddressSpace ( ) const
inlinevirtual

Return an AST address space which can be used opportunistically for constant global memory.

It must be possible to convert pointers into this address space to LangAS::Default. If no such address space exists, this may return None, and such optimizations will be disabled.

Reimplemented in clang::targets::AMDGPUTargetInfo.

Definition at line 978 of file TargetInfo.h.

Referenced by createReferenceTemporary().

◆ getConstraintRegister()

virtual StringRef clang::TargetInfo::getConstraintRegister ( const StringRef &  Constraint,
const StringRef &  Expression 
) const
inlinevirtual

Reimplemented in clang::targets::X86TargetInfo.

Definition at line 619 of file TargetInfo.h.

Referenced by getClobberConflictLocation().

◆ getCorrespondingUnsignedType()

static IntType clang::TargetInfo::getCorrespondingUnsignedType ( IntType  T)
inlinestatic

Definition at line 269 of file TargetInfo.h.

References clang::T.

◆ getCXXABI()

TargetCXXABI clang::TargetInfo::getCXXABI ( ) const
inline

◆ getDataLayout()

const llvm::DataLayout& clang::TargetInfo::getDataLayout ( ) const
inline

◆ getDefaultAlignForAttributeAligned()

unsigned clang::TargetInfo::getDefaultAlignForAttributeAligned ( ) const
inline

Return the default alignment for attribute((aligned)) on this target, to be used if no alignment value is specified.

Definition at line 373 of file TargetInfo.h.

Referenced by clang::ASTContext::getTargetDefaultAlignForAttributeAligned().

◆ getDefaultCallingConv()

virtual CallingConv clang::TargetInfo::getDefaultCallingConv ( CallingConvMethodType  MT) const
inlinevirtual

Gets the default calling convention for the given target and declaration context.

Reimplemented in clang::targets::X86_64TargetInfo, clang::targets::X86TargetInfo, and clang::targets::SPIRTargetInfo.

Definition at line 1001 of file TargetInfo.h.

References clang::CC_C.

Referenced by clang::ASTContext::getDefaultCallingConvention().

◆ getDoubleAlign()

unsigned clang::TargetInfo::getDoubleAlign ( ) const
inline

Definition at line 415 of file TargetInfo.h.

◆ getDoubleFormat()

const llvm::fltSemantics& clang::TargetInfo::getDoubleFormat ( ) const
inline

Definition at line 416 of file TargetInfo.h.

Referenced by clang::ASTContext::getFloatTypeSemantics().

◆ getDoubleWidth()

unsigned clang::TargetInfo::getDoubleWidth ( ) const
inline

getDoubleWidth/Align/Format - Return the size/align/format of 'double'.

Definition at line 414 of file TargetInfo.h.

Referenced by getRealTypeByWidth().

◆ getDWARFAddressSpace()

virtual Optional<unsigned> clang::TargetInfo::getDWARFAddressSpace ( unsigned  AddressSpace) const
inlinevirtual
Returns
If a target requires an address within a target specific address space AddressSpace to be converted in order to be used, then return the corresponding target specific DWARF address space.
Otherwise return None and no conversion will be emitted in the DWARF.

Reimplemented in clang::targets::AMDGPUTargetInfo.

Definition at line 1070 of file TargetInfo.h.

◆ getEHDataRegisterNumber()

virtual int clang::TargetInfo::getEHDataRegisterNumber ( unsigned  RegNo) const
inlinevirtual

Return the register number that __builtin_eh_return_regno would return with the specified argument.

This corresponds with TargetLowering's getExceptionPointerRegister and getExceptionSelectorRegister in the backend.

Reimplemented in clang::targets::X86_64TargetInfo, clang::targets::X86_32TargetInfo, clang::targets::MipsTargetInfo, clang::targets::PPCTargetInfo, clang::targets::ARMTargetInfo, clang::targets::HexagonTargetInfo, clang::targets::AArch64TargetInfo, clang::targets::XCoreTargetInfo, and clang::targets::SparcTargetInfo.

Definition at line 963 of file TargetInfo.h.

◆ getFloat128Align()

unsigned clang::TargetInfo::getFloat128Align ( ) const
inline

Definition at line 429 of file TargetInfo.h.

◆ getFloat128Format()

const llvm::fltSemantics& clang::TargetInfo::getFloat128Format ( ) const
inline

Definition at line 430 of file TargetInfo.h.

Referenced by clang::ASTContext::getFloatTypeSemantics().

◆ getFloat128Width()

unsigned clang::TargetInfo::getFloat128Width ( ) const
inline

getFloat128Width/Align/Format - Return the size/align/format of '__float128'.

Definition at line 428 of file TargetInfo.h.

◆ getFloatAlign()

unsigned clang::TargetInfo::getFloatAlign ( ) const
inline

Definition at line 410 of file TargetInfo.h.

◆ getFloatEvalMethod()

virtual unsigned clang::TargetInfo::getFloatEvalMethod ( ) const
inlinevirtual

Return the value for the C99 FLT_EVAL_METHOD macro.

Reimplemented in clang::targets::NetBSDI386TargetInfo, and clang::targets::X86TargetInfo.

Definition at line 439 of file TargetInfo.h.

◆ getFloatFormat()

const llvm::fltSemantics& clang::TargetInfo::getFloatFormat ( ) const
inline

Definition at line 411 of file TargetInfo.h.

Referenced by clang::ASTContext::getFloatTypeSemantics().

◆ getFloatWidth()

unsigned clang::TargetInfo::getFloatWidth ( ) const
inline

getFloatWidth/Align/Format - Return the size/align/format of 'float'.

Definition at line 409 of file TargetInfo.h.

Referenced by getRealTypeByWidth().

◆ getGCCAddlRegNames()

virtual ArrayRef<AddlRegName> clang::TargetInfo::getGCCAddlRegNames ( ) const
inlineprotectedvirtual

Reimplemented in clang::targets::X86TargetInfo, and clang::targets::AVRTargetInfo.

Definition at line 1091 of file TargetInfo.h.

◆ getGCCRegAliases()

virtual ArrayRef<GCCRegAlias> clang::TargetInfo::getGCCRegAliases ( ) const
protectedpure virtual

◆ getGCCRegNames()

virtual ArrayRef<const char *> clang::TargetInfo::getGCCRegNames ( ) const
protectedpure virtual

◆ getHalfAlign()

unsigned clang::TargetInfo::getHalfAlign ( ) const
inline

Definition at line 405 of file TargetInfo.h.

◆ getHalfFormat()

const llvm::fltSemantics& clang::TargetInfo::getHalfFormat ( ) const
inline

Definition at line 406 of file TargetInfo.h.

Referenced by clang::ASTContext::getFloatTypeSemantics().

◆ getHalfWidth()

unsigned clang::TargetInfo::getHalfWidth ( ) const
inline

getHalfWidth/Align/Format - Return the size/align/format of 'half'.

Definition at line 404 of file TargetInfo.h.

◆ getInt64Type()

IntType clang::TargetInfo::getInt64Type ( ) const
inline

Definition at line 262 of file TargetInfo.h.

◆ getIntAlign()

unsigned clang::TargetInfo::getIntAlign ( ) const
inline

Definition at line 347 of file TargetInfo.h.

Referenced by getMSMemberPointerSlots(), and getTypeAlign().

◆ getIntMaxTWidth()

unsigned clang::TargetInfo::getIntMaxTWidth ( ) const
inline

Return the size of intmax_t and uintmax_t for this target, in bits.

Definition at line 473 of file TargetInfo.h.

◆ getIntMaxType()

IntType clang::TargetInfo::getIntMaxType ( ) const
inline

Definition at line 244 of file TargetInfo.h.

Referenced by clang::ASTContext::getIntMaxType().

◆ getIntPtrType()

IntType clang::TargetInfo::getIntPtrType ( ) const
inline

Definition at line 254 of file TargetInfo.h.

Referenced by clang::ASTContext::getIntPtrType().

◆ getIntTypeByWidth()

TargetInfo::IntType TargetInfo::getIntTypeByWidth ( unsigned  BitWidth,
bool  IsSigned 
) const
virtual

◆ getIntWidth()

unsigned clang::TargetInfo::getIntWidth ( ) const
inline

getIntWidth/Align - Return the size of 'signed int' and 'unsigned int' for this target, in bits.

Definition at line 346 of file TargetInfo.h.

Referenced by clang::CharLiteralParser::CharLiteralParser(), EvaluateValue(), getIntTypeByWidth(), getLeastIntTypeByWidth(), getMSMemberPointerSlots(), getTypeConstantSuffix(), and getTypeWidth().

◆ getLargeArrayAlign()

unsigned clang::TargetInfo::getLargeArrayAlign ( ) const
inline

Definition at line 444 of file TargetInfo.h.

Referenced by clang::ASTContext::getDeclAlign().

◆ getLargeArrayMinWidth()

unsigned clang::TargetInfo::getLargeArrayMinWidth ( ) const
inline

Definition at line 443 of file TargetInfo.h.

Referenced by clang::ASTContext::getDeclAlign().

◆ getLeastIntTypeByWidth()

TargetInfo::IntType TargetInfo::getLeastIntTypeByWidth ( unsigned  BitWidth,
bool  IsSigned 
) const
virtual

◆ getLongAlign()

unsigned clang::TargetInfo::getLongAlign ( ) const
inline

Definition at line 352 of file TargetInfo.h.

Referenced by getTypeAlign().

◆ getLongDoubleAlign()

unsigned clang::TargetInfo::getLongDoubleAlign ( ) const
inline

Definition at line 421 of file TargetInfo.h.

◆ getLongDoubleFormat()

const llvm::fltSemantics& clang::TargetInfo::getLongDoubleFormat ( ) const
inline

◆ getLongDoubleWidth()

unsigned clang::TargetInfo::getLongDoubleWidth ( ) const
inline

getLongDoubleWidth/Align/Format - Return the size/align/format of 'long double'.

Definition at line 420 of file TargetInfo.h.

◆ getLongLongAlign()

unsigned clang::TargetInfo::getLongLongAlign ( ) const
inline

Definition at line 357 of file TargetInfo.h.

Referenced by getTypeAlign().

◆ getLongLongWidth()

unsigned clang::TargetInfo::getLongLongWidth ( ) const
inline

getLongLongWidth/Align - Return the size of 'signed long long' and 'unsigned long long' for this target, in bits.

Definition at line 356 of file TargetInfo.h.

Referenced by getIntTypeByWidth(), getLeastIntTypeByWidth(), and getTypeWidth().

◆ getLongWidth()

unsigned clang::TargetInfo::getLongWidth ( ) const
inline

getLongWidth/Align - Return the size of 'signed long' and 'unsigned long' for this target, in bits.

Definition at line 351 of file TargetInfo.h.

Referenced by getIntTypeByWidth(), getLeastIntTypeByWidth(), getObjCEncodingForPrimitiveKind(), and getTypeWidth().

◆ getMaxAtomicInlineWidth()

unsigned clang::TargetInfo::getMaxAtomicInlineWidth ( ) const
inline

Return the maximum width lock-free atomic operation which can be inlined given the supported features of the given target.

Definition at line 451 of file TargetInfo.h.

◆ getMaxAtomicPromoteWidth()

unsigned clang::TargetInfo::getMaxAtomicPromoteWidth ( ) const
inline

Return the maximum width lock-free atomic operation which will ever be supported for the given target.

Definition at line 448 of file TargetInfo.h.

◆ getMaxPointerWidth()

virtual uint64_t clang::TargetInfo::getMaxPointerWidth ( ) const
inlinevirtual

Return the maximum width of pointers on this target.

Reimplemented in clang::targets::AMDGPUTargetInfo.

Definition at line 319 of file TargetInfo.h.

Referenced by adjust(), and clang::ASTContext::getConstantArrayType().

◆ getMaxTLSAlign()

unsigned short clang::TargetInfo::getMaxTLSAlign ( ) const
inline

Return the maximum alignment (in bits) of a TLS variable.

Gets the maximum alignment (in bits) of a TLS variable on this target. Returns zero if there is no such constraint.

Definition at line 938 of file TargetInfo.h.

◆ getMaxVectorAlign()

unsigned clang::TargetInfo::getMaxVectorAlign ( ) const
inline

Return the maximum vector alignment supported for the given target.

Definition at line 466 of file TargetInfo.h.

◆ getMCountName()

const char* clang::TargetInfo::getMCountName ( ) const
inline

Returns the name of the mcount instrumentation function.

Definition at line 489 of file TargetInfo.h.

◆ getMinGlobalAlign()

unsigned clang::TargetInfo::getMinGlobalAlign ( ) const
inline

getMinGlobalAlign - Return the minimum alignment of a global variable, unless its alignment is explicitly reduced via attributes.

Definition at line 379 of file TargetInfo.h.

Referenced by clang::ASTContext::getDeclAlign().

◆ getNewAlign()

unsigned clang::TargetInfo::getNewAlign ( ) const
inline

Return the largest alignment for which a suitably-sized allocation with '::operator new(size_t)' is guaranteed to produce a correctly-aligned pointer.

Definition at line 384 of file TargetInfo.h.

References max().

Referenced by hasNewExtendedAlignment().

◆ getNormalizedGCCRegisterName()

StringRef TargetInfo::getNormalizedGCCRegisterName ( StringRef  Name,
bool  ReturnCanonical = false 
) const

Returns the "normalized" GCC register name.

ReturnCannonical true will return the register name without any additions such as "{}" or "%" in it's canonical form, for example: ReturnCanonical = true and Name = "rax", will return "ax".

Definition at line 449 of file TargetInfo.cpp.

Referenced by AddVariableConstraints(), extractRegisterName(), and getClobberConflictLocation().

◆ getNullPointerValue()

virtual uint64_t clang::TargetInfo::getNullPointerValue ( LangAS  AddrSpace) const
inlinevirtual

Get integer value for null pointer.

Parameters
AddrSpaceaddress space of pointee in source language.

Reimplemented in clang::targets::AMDGPUTargetInfo.

Definition at line 325 of file TargetInfo.h.

Referenced by clang::ASTContext::getTargetNullPointerValue().

◆ getOpenCLTypeAddrSpace()

LangAS TargetInfo::getOpenCLTypeAddrSpace ( const Type T) const
virtual

◆ getPlatformMinVersion()

VersionTuple clang::TargetInfo::getPlatformMinVersion ( ) const
inline

Retrieve the minimum desired version of the platform, to which the program should be compiled.

Definition at line 988 of file TargetInfo.h.

Referenced by checkObjCMethodX86VectorTypes().

◆ getPlatformName()

StringRef clang::TargetInfo::getPlatformName ( ) const
inline

Retrieve the name of the platform as it is used in the availability attribute.

Definition at line 984 of file TargetInfo.h.

Referenced by diagnoseUnavailableAlignedAllocation().

◆ getPointerAlign()

uint64_t clang::TargetInfo::getPointerAlign ( unsigned  AddrSpace) const
inline

◆ getPointerAlignV()

virtual uint64_t clang::TargetInfo::getPointerAlignV ( unsigned  AddrSpace) const
inlineprotectedvirtual

Reimplemented in clang::targets::AMDGPUTargetInfo.

Definition at line 1083 of file TargetInfo.h.

◆ getPointerWidth()

uint64_t clang::TargetInfo::getPointerWidth ( unsigned  AddrSpace) const
inline

◆ getPointerWidthV()

virtual uint64_t clang::TargetInfo::getPointerWidthV ( unsigned  AddrSpace) const
inlineprotectedvirtual

Reimplemented in clang::targets::AMDGPUTargetInfo.

Definition at line 1080 of file TargetInfo.h.

◆ getProcessIDType()

IntType clang::TargetInfo::getProcessIDType ( ) const
inline

Definition at line 267 of file TargetInfo.h.

Referenced by clang::ASTContext::getProcessIDType().

◆ getPtrDiffType()

IntType clang::TargetInfo::getPtrDiffType ( unsigned  AddrSpace) const
inline

Definition at line 248 of file TargetInfo.h.

Referenced by clang::ASTContext::getPointerDiffType().

◆ getPtrDiffTypeV()

virtual enum IntType clang::TargetInfo::getPtrDiffTypeV ( unsigned  AddrSpace) const
inlineprotectedvirtual

Definition at line 1086 of file TargetInfo.h.

◆ getRealTypeByWidth()

TargetInfo::RealType TargetInfo::getRealTypeByWidth ( unsigned  BitWidth) const

Return floating point type with specified width.

Definition at line 226 of file TargetInfo.cpp.

References Double, Float, Float128, getDoubleWidth(), getFloatWidth(), getLongDoubleFormat(), hasFloat128Type(), LongDouble, and NoFloat.

Referenced by clang::ASTContext::getRealTypeForBitwidth().

◆ getRegisterWidth()

virtual unsigned clang::TargetInfo::getRegisterWidth ( ) const
inlinevirtual

Return the "preferred" register width on this target.

Reimplemented in clang::targets::X86_64TargetInfo.

Definition at line 481 of file TargetInfo.h.

◆ getRegParmMax()

unsigned clang::TargetInfo::getRegParmMax ( ) const
inline

Definition at line 924 of file TargetInfo.h.

◆ getShortAlign()

unsigned clang::TargetInfo::getShortAlign ( ) const
inline

Return the alignment of 'signed short' and 'unsigned short' for this target.

Definition at line 342 of file TargetInfo.h.

Referenced by getTypeAlign().

◆ getShortWidth()

unsigned clang::TargetInfo::getShortWidth ( ) const
inline

Return the size of 'signed short' and 'unsigned short' for this target, in bits.

Definition at line 338 of file TargetInfo.h.

Referenced by getIntTypeByWidth(), getLeastIntTypeByWidth(), getTypeConstantSuffix(), and getTypeWidth().

◆ getSigAtomicType()

IntType clang::TargetInfo::getSigAtomicType ( ) const
inline

Definition at line 266 of file TargetInfo.h.

◆ getSignedSizeType()

IntType clang::TargetInfo::getSignedSizeType ( ) const
inline

Definition at line 230 of file TargetInfo.h.

Referenced by clang::ASTContext::getSignedSizeType().

◆ getSimdDefaultAlign()

unsigned clang::TargetInfo::getSimdDefaultAlign ( ) const
inline

Return default simd alignment for the given target.

Generally, this value is type-specific, but this alignment can be used for most of the types for the given target.

Definition at line 470 of file TargetInfo.h.

Referenced by clang::ASTContext::getOpenMPDefaultSimdAlign().

◆ getSizeType()

IntType clang::TargetInfo::getSizeType ( ) const
inline

Definition at line 229 of file TargetInfo.h.

Referenced by clang::ASTContext::getSizeType().

◆ getStaticInitSectionSpecifier()

virtual const char* clang::TargetInfo::getStaticInitSectionSpecifier ( ) const
inlinevirtual

◆ getSuitableAlign()

unsigned clang::TargetInfo::getSuitableAlign ( ) const
inline

Return the alignment that is suitable for storing any object with a fundamental alignment requirement.

Definition at line 369 of file TargetInfo.h.

◆ getSupportedOpenCLOpts() [1/2]

OpenCLOptions& clang::TargetInfo::getSupportedOpenCLOpts ( )
inline

Get supported OpenCL extensions and optional core features.

Definition at line 1047 of file TargetInfo.h.

Referenced by clang::Sema::Initialize().

◆ getSupportedOpenCLOpts() [2/2]

const OpenCLOptions& clang::TargetInfo::getSupportedOpenCLOpts ( ) const
inline

Get const supported OpenCL extensions and optional core features.

Definition at line 1052 of file TargetInfo.h.

◆ getTargetBuiltins()

virtual ArrayRef<Builtin::Info> clang::TargetInfo::getTargetBuiltins ( ) const
pure virtual

◆ getTargetDefines()

virtual void clang::TargetInfo::getTargetDefines ( const LangOptions Opts,
MacroBuilder Builder 
) const
pure virtual

===-— Other target property query methods --------------------——===//

Appends the target-specific #define values for this target set to the specified buffer.

Implemented in clang::targets::CygwinX86_64TargetInfo, clang::targets::MinGWX86_64TargetInfo, clang::targets::MicrosoftX86_64TargetInfo, clang::targets::WindowsX86_64TargetInfo, clang::targets::RTEMSX86_32TargetInfo, clang::targets::MCUX86_32TargetInfo, clang::targets::HaikuX86_32TargetInfo, clang::targets::CygwinX86_32TargetInfo, clang::targets::MinGWX86_32TargetInfo, clang::targets::MicrosoftX86_32TargetInfo, clang::targets::WindowsX86_32TargetInfo, clang::targets::X86TargetInfo, clang::targets::SparcV9TargetInfo, clang::targets::RenderScript32TargetInfo, clang::targets::CygwinARMTargetInfo, clang::targets::MinGWARMTargetInfo, clang::targets::SparcV8TargetInfo, clang::targets::AMDGPUTargetInfo, clang::targets::MicrosoftARMleTargetInfo, clang::targets::ItaniumWindowsARMleTargetInfo, clang::targets::MipsTargetInfo, clang::targets::ARMbeTargetInfo, clang::targets::ARMleTargetInfo, clang::targets::RenderScript64TargetInfo, clang::targets::WebAssembly64TargetInfo, clang::targets::ARMTargetInfo, clang::targets::AArch64beTargetInfo, clang::targets::MinGWARM64TargetInfo, clang::targets::SPIR64TargetInfo, clang::targets::WebAssembly32TargetInfo, clang::targets::TCELETargetInfo, clang::targets::MicrosoftARM64TargetInfo, clang::targets::SPIR32TargetInfo, clang::targets::PPCTargetInfo, clang::targets::AArch64leTargetInfo, clang::targets::HexagonTargetInfo, clang::targets::TCETargetInfo, clang::targets::Nios2TargetInfo, clang::targets::LanaiTargetInfo, clang::targets::AVRTargetInfo, clang::targets::AArch64TargetInfo, clang::targets::SPIRTargetInfo, clang::targets::SystemZTargetInfo, clang::targets::WebAssemblyTargetInfo, clang::targets::NVPTXTargetInfo, clang::targets::SparcTargetInfo, clang::targets::MSP430TargetInfo, clang::targets::PNaClTargetInfo, clang::targets::BPFTargetInfo, clang::targets::XCoreTargetInfo, clang::targets::Le64TargetInfo, clang::targets::OSTargetInfo< PPC32TargetInfo >, clang::targets::OSTargetInfo< X86_64TargetInfo >, clang::targets::OSTargetInfo< PPC64TargetInfo >, clang::targets::OSTargetInfo< ARMleTargetInfo >, clang::targets::OSTargetInfo< AArch64leTargetInfo >, and clang::targets::OSTargetInfo< X86_32TargetInfo >.

◆ getTargetOpts()

TargetOptions& clang::TargetInfo::getTargetOpts ( ) const
inline

Retrieve the target options.

Definition at line 122 of file TargetInfo.h.

Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList().

◆ getTriple()

const llvm::Triple& clang::TargetInfo::getTriple ( ) const
inline

Returns the target triple of the primary target.

Definition at line 782 of file TargetInfo.h.

Referenced by clang::targets::AArch64leTargetInfo::AArch64leTargetInfo(), clang::targets::AArch64TargetInfo::AArch64TargetInfo(), clang::targets::AMDGPUTargetInfo::adjust(), clang::targets::AMDGPUTargetInfo::AMDGPUTargetInfo(), clang::targets::ARMTargetInfo::ARMTargetInfo(), clang::arcmt::trans::canApplyWeak(), checkObjCMethodX86VectorTypes(), checkVAStartABI(), configureBlocksRuntimeObject(), clang::CodeGen::CreateItaniumCXXABI(), diagnoseUnavailableAlignedAllocation(), clang::CodeGen::CodeGenFunction::EmitBuiltinAvailable(), EmitGlobalDeclMetadata(), emitGlobalDtorWithCXAAtExit(), emitGlobalDtorWithTLRegDtor(), clang::CompilerInstance::ExecuteAction(), clang::CodeGen::EHPersonality::get(), clang::analyze_printf::PrintfSpecifier::getArgType(), clang::analyze_scanf::ScanfSpecifier::getArgType(), clang::targets::ARMTargetInfo::getBuiltinVaListKind(), getCodegenToUse(), getMaxAtomicAccessSize(), getMSMemberPointerSlots(), clang::ASTContext::getNSIntegerType(), clang::ASTContext::getNSUIntegerType(), clang::CodeGen::CodeGenModule::getTargetCodeGenInfo(), clang::CodeGen::CodeGenModule::getTriple(), getTypeInfoLinkage(), clang::analyze_format_string::FormatSpecifier::hasValidLengthModifier(), clang::targets::ARMTargetInfo::initFeatureMap(), clang::Sema::InstantiateClassMembers(), clang::CodeGen::ABIInfo::isAndroid(), isArc4RandomAvailable(), clang::FunctionDecl::isMSVCRTEntryPoint(), isPermittedNeonBaseType(), isThreadWrapperReplaceable(), clang::CodeGen::CodeGenModule::maybeSetTrivialComdat(), clang::CodeGen::CodeGenModule::Release(), supportsNilWithFloatRet(), clang::targets::MipsTargetInfo::validateTarget(), Write__class_ro_t_initializer(), and WriteModernMetadataDeclarations().

◆ getTypeAlign()

unsigned TargetInfo::getTypeAlign ( IntType  T) const

Return the alignment (in bits) of the specified integer type enum.

getTypeAlign - Return the alignment (in bits) of the specified integer type enum.

For example, SignedInt -> getIntAlign().

Definition at line 251 of file TargetInfo.cpp.

References getCharAlign(), getIntAlign(), getLongAlign(), getLongLongAlign(), getShortAlign(), SignedChar, SignedInt, SignedLong, SignedLongLong, SignedShort, UnsignedChar, UnsignedInt, UnsignedLong, UnsignedLongLong, and UnsignedShort.

◆ getTypeConstantSuffix()

const char * TargetInfo::getTypeConstantSuffix ( IntType  T) const

Return the constant suffix for the specified integer type enum.

getTypeConstantSuffix - Return the constant suffix for the specified integer type enum.

For example, SignedLong -> "L".

Definition at line 137 of file TargetInfo.cpp.

References getCharWidth(), getIntWidth(), getShortWidth(), SignedChar, SignedInt, SignedLong, SignedLongLong, SignedShort, UnsignedChar, UnsignedInt, UnsignedLong, UnsignedLongLong, and UnsignedShort.

◆ getTypeFormatModifier()

const char * TargetInfo::getTypeFormatModifier ( IntType  T)
static

Return the printf format modifier for the specified integer type enum.

getTypeFormatModifier - Return the printf format modifier for the specified integer type enum.

For example, SignedLong -> "l".

Definition at line 162 of file TargetInfo.cpp.

References SignedChar, SignedInt, SignedLong, SignedLongLong, SignedShort, UnsignedChar, UnsignedInt, UnsignedLong, UnsignedLongLong, and UnsignedShort.

◆ getTypeName()

const char * TargetInfo::getTypeName ( IntType  T)
static

Return the user string for the specified integer type enum.

getTypeName - Return the user string for the specified integer type enum.

For example, SignedShort -> "short".

Definition at line 119 of file TargetInfo.cpp.

References SignedChar, SignedInt, SignedLong, SignedLongLong, SignedShort, UnsignedChar, UnsignedInt, UnsignedLong, UnsignedLongLong, and UnsignedShort.

◆ getTypeWidth()

unsigned TargetInfo::getTypeWidth ( IntType  T) const

Return the width (in bits) of the specified integer type enum.

getTypeWidth - Return the width (in bits) of the specified integer type enum.

For example, SignedInt -> getIntWidth().

Definition at line 180 of file TargetInfo.cpp.

References getCharWidth(), getIntWidth(), getLongLongWidth(), getLongWidth(), getShortWidth(), SignedChar, SignedInt, SignedLong, SignedLongLong, SignedShort, UnsignedChar, UnsignedInt, UnsignedLong, UnsignedLongLong, and UnsignedShort.

◆ getUInt64Type()

IntType clang::TargetInfo::getUInt64Type ( ) const
inline

Definition at line 263 of file TargetInfo.h.

◆ getUIntMaxType()

IntType clang::TargetInfo::getUIntMaxType ( ) const
inline

Definition at line 245 of file TargetInfo.h.

Referenced by clang::ASTContext::getUIntMaxType().

◆ getUIntPtrType()

IntType clang::TargetInfo::getUIntPtrType ( ) const
inline

Definition at line 255 of file TargetInfo.h.

◆ getUnsignedPtrDiffType()

IntType clang::TargetInfo::getUnsignedPtrDiffType ( unsigned  AddrSpace) const
inline

Definition at line 251 of file TargetInfo.h.

Referenced by clang::ASTContext::getUnsignedPointerDiffType().

◆ getUnwindWordWidth()

virtual unsigned clang::TargetInfo::getUnwindWordWidth ( ) const
inlinevirtual

Reimplemented in clang::targets::X86_64TargetInfo.

Definition at line 478 of file TargetInfo.h.

◆ getVtblPtrAddressSpace()

virtual unsigned clang::TargetInfo::getVtblPtrAddressSpace ( ) const
inlinevirtual
Returns
Target specific vtbl ptr address space.

Reimplemented in clang::targets::AMDGPUTargetInfo.

Definition at line 1060 of file TargetInfo.h.

◆ getWCharAlign()

unsigned clang::TargetInfo::getWCharAlign ( ) const
inline

Definition at line 391 of file TargetInfo.h.

◆ getWCharType()

IntType clang::TargetInfo::getWCharType ( ) const
inline

Definition at line 258 of file TargetInfo.h.

Referenced by EvaluateValue().

◆ getWCharWidth()

unsigned clang::TargetInfo::getWCharWidth ( ) const
inline

getWCharWidth/Align - Return the size of 'wchar_t' for this target, in bits.

Definition at line 390 of file TargetInfo.h.

Referenced by clang::CharLiteralParser::CharLiteralParser(), EvaluateValue(), getCharWidth(), and clang::FloatingLiteral::getValueAsApproximateDouble().

◆ getWIntType()

IntType clang::TargetInfo::getWIntType ( ) const
inline

Definition at line 259 of file TargetInfo.h.

◆ getZeroLengthBitfieldBoundary()

unsigned clang::TargetInfo::getZeroLengthBitfieldBoundary ( ) const
inline

Get the fixed alignment value in bits for a member that follows a zero length bitfield.

Definition at line 519 of file TargetInfo.h.

Referenced by roundUpSizeToCharAlignment().

◆ handleTargetFeatures()

virtual bool clang::TargetInfo::handleTargetFeatures ( std::vector< std::string > &  Features,
DiagnosticsEngine Diags 
)
inlinevirtual

Perform initialization based on the user configured set of features (e.g., +sse4).

The list is guaranteed to have at most one entry per feature.

The target may modify the features list, to change which options are passed onwards to the backend. FIXME: This part should be fixed so that we can change handleTargetFeatures to merely a TargetInfo initialization routine.

Returns
False on error.

Reimplemented in clang::targets::DarwinX86_64TargetInfo, clang::targets::DarwinI386TargetInfo, clang::targets::X86TargetInfo, clang::targets::MipsTargetInfo, clang::targets::ARMTargetInfo, clang::targets::PPCTargetInfo, clang::targets::SystemZTargetInfo, clang::targets::HexagonTargetInfo, clang::targets::AArch64TargetInfo, and clang::targets::SparcTargetInfo.

Definition at line 905 of file TargetInfo.h.

◆ hasAlignMac68kSupport()

bool clang::TargetInfo::hasAlignMac68kSupport ( ) const
inline

Check whether this target support '#pragma options align=mac68k'.

Definition at line 530 of file TargetInfo.h.

References clang::driver::types::getTypeName().

◆ hasBuiltinAtomic()

virtual bool clang::TargetInfo::hasBuiltinAtomic ( uint64_t  AtomicSizeInBits,
uint64_t  AlignmentInBits 
) const
inlinevirtual

Returns true if the given target supports lock-free atomic operations at the specified width and alignment.

Definition at line 457 of file TargetInfo.h.

References getCharWidth().

◆ hasBuiltinMSVaList()

bool clang::TargetInfo::hasBuiltinMSVaList ( ) const
inline

Returns whether or not type __builtin_ms_va_list type is available on this target.

Definition at line 594 of file TargetInfo.h.

◆ hasFeature()

virtual bool clang::TargetInfo::hasFeature ( StringRef  Feature) const
inlinevirtual

◆ hasFloat128Type()

virtual bool clang::TargetInfo::hasFloat128Type ( ) const
inlinevirtual

Determine whether the __float128 type is supported on this target.

Definition at line 365 of file TargetInfo.h.

Referenced by getRealTypeByWidth().

◆ hasInt128Type()

virtual bool clang::TargetInfo::hasInt128Type ( ) const
inlinevirtual

Determine whether the __int128 type is supported on this target.

Reimplemented in clang::targets::X86_64TargetInfo, and clang::targets::MipsTargetInfo.

Definition at line 360 of file TargetInfo.h.

Referenced by clang::Sema::Initialize(), and clang::CodeGen::swiftcall::isLegalIntegerType().

◆ hasNoAsmVariants()

bool clang::TargetInfo::hasNoAsmVariants ( ) const
inline

Return true if {|} are normal characters in the asm string.

If this returns false (the default), then {abc|xyz} is syntax that says that when compiling for asm variant #0, "abc" should be generated, but when compiling for asm variant #1, "xyz" should be generated.

Definition at line 955 of file TargetInfo.h.

Referenced by clang::GCCAsmStmt::AnalyzeAsmString().

◆ hasProtectedVisibility()

virtual bool clang::TargetInfo::hasProtectedVisibility ( ) const
inlinevirtual

Does this target support "protected" visibility?

Any target which dynamic libraries will naturally support something like "default" (meaning that the symbol is visible outside this shared object) and "hidden" (meaning that it isn't) visibilities, but "protected" is really an ELF-specific concept with weird semantics designed around the convenience of dynamic linker implementations. Which is not to suggest that there's consistent target-independent semantics for "default" visibility either; the entire thing is pretty badly mangled.

Reimplemented in clang::targets::DarwinTargetInfo< PPC32TargetInfo >, clang::targets::DarwinTargetInfo< X86_64TargetInfo >, clang::targets::DarwinTargetInfo< PPC64TargetInfo >, clang::targets::DarwinTargetInfo< ARMleTargetInfo >, clang::targets::DarwinTargetInfo< AArch64leTargetInfo >, clang::targets::DarwinTargetInfo< X86_32TargetInfo >, and clang::targets::Le64TargetInfo.

Definition at line 811 of file TargetInfo.h.

◆ hasSjLjLowering()

virtual bool clang::TargetInfo::hasSjLjLowering ( ) const
inlinevirtual

Controls if __builtin_longjmp / __builtin_setjmp can be lowered to llvm.eh.sjlj.longjmp / llvm.eh.sjlj.setjmp.

Reimplemented in clang::targets::X86TargetInfo, clang::targets::PPCTargetInfo, clang::targets::SparcV8TargetInfo, clang::targets::ARMTargetInfo, and clang::targets::SparcTargetInfo.

Definition at line 1029 of file TargetInfo.h.

◆ initFeatureMap()

bool TargetInfo::initFeatureMap ( llvm::StringMap< bool > &  Features,
DiagnosticsEngine Diags,
StringRef  CPU,
const std::vector< std::string > &  FeatureVec 
) const
virtual

◆ isBigEndian()

bool clang::TargetInfo::isBigEndian ( ) const
inline

Definition at line 990 of file TargetInfo.h.

Referenced by EmitSignBit(), and warnBracedScalarInit().

◆ isCLZForZeroUndef()

virtual bool clang::TargetInfo::isCLZForZeroUndef ( ) const
inlinevirtual

The __builtin_clz* and __builtin_ctz* built-in functions are specified to have undefined results for zero inputs, but on targets that support these operations in a way that provides well-defined results for zero without loss of performance, it is a good idea to avoid optimizing based on that undef behavior.

Reimplemented in clang::targets::MipsTargetInfo, clang::targets::ARMTargetInfo, clang::targets::PPCTargetInfo, clang::targets::HexagonTargetInfo, and clang::targets::AArch64TargetInfo.

Definition at line 586 of file TargetInfo.h.

◆ isLittleEndian()

bool clang::TargetInfo::isLittleEndian ( ) const
inline

Definition at line 991 of file TargetInfo.h.

◆ isNan2008()

virtual bool clang::TargetInfo::isNan2008 ( ) const
inlinevirtual

Returns true if NaN encoding is IEEE 754-2008.

Only MIPS allows a different encoding.

Reimplemented in clang::targets::MipsTargetInfo.

Definition at line 777 of file TargetInfo.h.

◆ isRenderScriptTarget()

bool clang::TargetInfo::isRenderScriptTarget ( ) const
inline

Returns true for RenderScript.

Definition at line 597 of file TargetInfo.h.

◆ isSEHTrySupported()

bool clang::TargetInfo::isSEHTrySupported ( ) const
inline

Whether the target supports SEH __try.

Definition at line 943 of file TargetInfo.h.

◆ isTLSSupported()

bool clang::TargetInfo::isTLSSupported ( ) const
inline

◆ isTypeSigned()

bool TargetInfo::isTypeSigned ( IntType  T)
static

Returns true if the type is signed; false otherwise.

isTypeSigned - Return whether an integer types is signed.

Returns true if the type is signed; false otherwise.

Definition at line 269 of file TargetInfo.cpp.

References SignedChar, SignedInt, SignedLong, SignedLongLong, SignedShort, UnsignedChar, UnsignedInt, UnsignedLong, UnsignedLongLong, and UnsignedShort.

Referenced by EvaluateValue(), and clang::ASTContext::InitBuiltinTypes().

◆ isValidClobber()

bool TargetInfo::isValidClobber ( StringRef  Name) const

Returns whether the passed in string is a valid clobber in an inline asm statement.

isValidClobber - Returns whether the passed in string is a valid clobber in an inline asm statement.

This is used by Sema.

Definition at line 396 of file TargetInfo.cpp.

◆ isValidCPUName()

virtual bool clang::TargetInfo::isValidCPUName ( StringRef  Name) const
inlinevirtual

◆ isValidFeatureName()

virtual bool clang::TargetInfo::isValidFeatureName ( StringRef  Feature) const
inlinevirtual

Determine whether this TargetInfo supports the given feature.

Reimplemented in clang::targets::X86TargetInfo.

Definition at line 890 of file TargetInfo.h.

◆ isValidGCCRegisterName()

bool TargetInfo::isValidGCCRegisterName ( StringRef  Name) const

Returns whether the passed in string is a valid register name according to GCC.

isValidGCCRegisterName - Returns whether the passed in string is a valid register name according to GCC.

This is used by Sema for inline asm statements.

Definition at line 404 of file TargetInfo.cpp.

Referenced by AddVariableConstraints(), and extractRegisterName().

◆ isValidSectionSpecifier()

virtual std::string clang::TargetInfo::isValidSectionSpecifier ( StringRef  SR) const
inlinevirtual

An optional hook that targets can implement to perform semantic checking on attribute((section("foo"))) specifiers.

In this case, "foo" is passed in to be checked. If the section specifier is invalid, the backend should return a non-empty string that indicates the problem.

This hook is a simple quality of implementation feature to catch errors and give good diagnostics in cases when the assembler or code generator would otherwise reject the section specifier.

Reimplemented in clang::targets::DarwinTargetInfo< PPC32TargetInfo >, clang::targets::DarwinTargetInfo< X86_64TargetInfo >, clang::targets::DarwinTargetInfo< PPC64TargetInfo >, clang::targets::DarwinTargetInfo< ARMleTargetInfo >, clang::targets::DarwinTargetInfo< AArch64leTargetInfo >, and clang::targets::DarwinTargetInfo< X86_32TargetInfo >.

Definition at line 824 of file TargetInfo.h.

◆ noSignedCharForObjCBool()

void clang::TargetInfo::noSignedCharForObjCBool ( )
inline

Definition at line 501 of file TargetInfo.h.

Referenced by clang::CompilerInstance::ExecuteAction().

◆ resetDataLayout()

void clang::TargetInfo::resetDataLayout ( StringRef  DL)
inlineprotected

◆ resolveSymbolicName()

bool TargetInfo::resolveSymbolicName ( const char *&  Name,
ArrayRef< ConstraintInfo OutputConstraints,
unsigned &  Index 
) const

Definition at line 564 of file TargetInfo.cpp.

Referenced by SimplifyConstraint().

◆ setABI()

virtual bool clang::TargetInfo::setABI ( const std::string &  Name)
inlinevirtual

Use the specified ABI.

Returns
False on error (invalid ABI name).

Reimplemented in clang::targets::PPC64TargetInfo, clang::targets::ARMTargetInfo, clang::targets::MipsTargetInfo, clang::targets::Nios2TargetInfo, and clang::targets::AArch64TargetInfo.

Definition at line 870 of file TargetInfo.h.

◆ setCPU()

virtual bool clang::TargetInfo::setCPU ( const std::string &  Name)
inlinevirtual

◆ setFeatureEnabled()

virtual void clang::TargetInfo::setFeatureEnabled ( llvm::StringMap< bool > &  Features,
StringRef  Name,
bool  Enabled 
) const
inlinevirtual

Enable or disable a specific target feature; the feature name must be valid.

Reimplemented in clang::targets::X86TargetInfo, and clang::targets::PPCTargetInfo.

Definition at line 883 of file TargetInfo.h.

◆ setFPMath()

virtual bool clang::TargetInfo::setFPMath ( StringRef  Name)
inlinevirtual

Use the specified unit for FP math.

Returns
False on error (invalid unit name).

Reimplemented in clang::targets::X86TargetInfo, and clang::targets::ARMTargetInfo.

Definition at line 877 of file TargetInfo.h.

◆ setMaxAtomicWidth()

virtual void clang::TargetInfo::setMaxAtomicWidth ( )
inlinevirtual

Set the maximum inline or promote width lock-free atomic operation for the given target.

Reimplemented in clang::targets::X86_64TargetInfo.

Definition at line 454 of file TargetInfo.h.

◆ setOpenCLExtensionOpts()

virtual void clang::TargetInfo::setOpenCLExtensionOpts ( )
inlinevirtual

Set supported OpenCL extensions as written on command line.

Definition at line 1040 of file TargetInfo.h.

◆ setSupportedOpenCLOpts()

virtual void clang::TargetInfo::setSupportedOpenCLOpts ( )
inlinevirtual

Set supported OpenCL extensions and optional core features.

Reimplemented in clang::targets::X86TargetInfo, clang::targets::AMDGPUTargetInfo, clang::targets::NVPTXTargetInfo, and clang::targets::SPIRTargetInfo.

Definition at line 1037 of file TargetInfo.h.

◆ useAddressSpaceMapMangling()

bool clang::TargetInfo::useAddressSpaceMapMangling ( ) const
inline

Specify if mangling based on address space map should be used or not for language specific address spaces.

Definition at line 564 of file TargetInfo.h.

Referenced by isAddrSpaceMapManglingEnabled().

◆ useBitFieldTypeAlignment()

bool clang::TargetInfo::useBitFieldTypeAlignment ( ) const
inline

Check whether the alignment of bit-field types is respected when laying out structures.

Definition at line 507 of file TargetInfo.h.

Referenced by roundUpSizeToCharAlignment().

◆ useExplicitBitFieldAlignment()

bool clang::TargetInfo::useExplicitBitFieldAlignment ( ) const
inline

Check whether explicit bitfield alignment attributes should be.

Definition at line 525 of file TargetInfo.h.

Referenced by roundUpSizeToCharAlignment().

◆ useFloat128ManglingForLongDouble()

virtual bool clang::TargetInfo::useFloat128ManglingForLongDouble ( ) const
inlinevirtual

Return true if the 'long double' type should be mangled like __float128.

Reimplemented in clang::targets::AndroidX86_64TargetInfo, clang::targets::PPCTargetInfo, and clang::targets::SystemZTargetInfo.

Definition at line 436 of file TargetInfo.h.

◆ useObjCFP2RetForComplexLongDouble()

bool clang::TargetInfo::useObjCFP2RetForComplexLongDouble ( ) const
inline

Check whether _Complex long double should use the "fp2ret" flavor of Objective-C message passing on this target.

Definition at line 558 of file TargetInfo.h.

Referenced by clang::CodeGen::CodeGenModule::ReturnTypeUsesFP2Ret().

◆ useObjCFPRetForRealType()

bool clang::TargetInfo::useObjCFPRetForRealType ( RealType  T) const
inline

Check whether the given real type should use the "fpret" flavor of Objective-C message passing on this target.

Definition at line 552 of file TargetInfo.h.

References clang::T.

Referenced by clang::CodeGen::CodeGenModule::ReturnTypeUsesFPRet().

◆ useSignedCharForObjCBool()

bool clang::TargetInfo::useSignedCharForObjCBool ( ) const
inline

Check if the Objective-C built-in boolean type should be signed char.

Otherwise, if this returns false, the normal built-in boolean type should also be used for Objective-C.

Definition at line 498 of file TargetInfo.h.

◆ useZeroLengthBitfieldAlignment()

bool clang::TargetInfo::useZeroLengthBitfieldAlignment ( ) const
inline

Check whether zero length bitfields should force alignment of the next member.

Definition at line 513 of file TargetInfo.h.

Referenced by roundUpSizeToCharAlignment().

◆ validateAsmConstraint()

virtual bool clang::TargetInfo::validateAsmConstraint ( const char *&  Name,
TargetInfo::ConstraintInfo info 
) const
pure virtual

◆ validateConstraintModifier()

virtual bool clang::TargetInfo::validateConstraintModifier ( StringRef  ,
char  ,
unsigned  ,
std::string &   
) const
inlinevirtual

Reimplemented in clang::targets::ARMTargetInfo, and clang::targets::AArch64TargetInfo.

Definition at line 748 of file TargetInfo.h.

◆ validateCpuIs()

virtual bool clang::TargetInfo::validateCpuIs ( StringRef  Name) const
inlinevirtual

Reimplemented in clang::targets::X86TargetInfo.

Definition at line 921 of file TargetInfo.h.

Referenced by SemaBuiltinCpuIs().

◆ validateCpuSupports()

virtual bool clang::TargetInfo::validateCpuSupports ( StringRef  Name) const
inlinevirtual

Reimplemented in clang::targets::X86TargetInfo.

Definition at line 917 of file TargetInfo.h.

Referenced by SemaBuiltinCpuSupports().

◆ validateGlobalRegisterVariable()

virtual bool clang::TargetInfo::validateGlobalRegisterVariable ( StringRef  RegName,
unsigned  RegSize,
bool HasSizeMismatch 
) const
inlinevirtual

Validate register name used for global register variables.

This function returns true if the register passed in RegName can be used for global register variables on this target. In addition, it returns true in HasSizeMismatch if the size of the register doesn't match the variable size passed in RegSize.

Reimplemented in clang::targets::X86_64TargetInfo, and clang::targets::X86TargetInfo.

Definition at line 724 of file TargetInfo.h.

◆ validateInputConstraint()

bool TargetInfo::validateInputConstraint ( MutableArrayRef< ConstraintInfo OutputConstraints,
ConstraintInfo info 
) const

Definition at line 587 of file TargetInfo.cpp.

◆ validateInputSize()

virtual bool clang::TargetInfo::validateInputSize ( StringRef  ,
unsigned   
) const
inlinevirtual

Reimplemented in clang::targets::X86TargetInfo.

Definition at line 743 of file TargetInfo.h.

◆ validateOutputConstraint()

bool TargetInfo::validateOutputConstraint ( ConstraintInfo Info) const

Definition at line 490 of file TargetInfo.cpp.

Referenced by AddVariableConstraints().

◆ validateOutputSize()

virtual bool clang::TargetInfo::validateOutputSize ( StringRef  ,
unsigned   
) const
inlinevirtual

Reimplemented in clang::targets::X86TargetInfo.

Definition at line 738 of file TargetInfo.h.

◆ validateTarget()

virtual bool clang::TargetInfo::validateTarget ( DiagnosticsEngine Diags) const
inlinevirtual

Check the target is valid after it is fully initialized.

Reimplemented in clang::targets::MipsTargetInfo.

Definition at line 1075 of file TargetInfo.h.

Member Data Documentation

◆ AddrSpaceMap

const LangASMap* clang::TargetInfo::AddrSpaceMap
protected

Definition at line 89 of file TargetInfo.h.

Referenced by clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().

◆ BigEndian

bool clang::TargetInfo::BigEndian
protected

Definition at line 61 of file TargetInfo.h.

Referenced by TargetInfo().

◆ BoolAlign

unsigned char clang::TargetInfo::BoolAlign
protected

Definition at line 66 of file TargetInfo.h.

Referenced by clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().

◆ BoolWidth

unsigned char clang::TargetInfo::BoolWidth
protected

Definition at line 66 of file TargetInfo.h.

Referenced by clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().

◆ Char16Type

IntType clang::TargetInfo::Char16Type
protected

Definition at line 192 of file TargetInfo.h.

Referenced by clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().

◆ Char32Type

IntType clang::TargetInfo::Char32Type
protected

Definition at line 192 of file TargetInfo.h.

Referenced by clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().

◆ ComplexLongDoubleUsesFP2Ret

unsigned clang::TargetInfo::ComplexLongDoubleUsesFP2Ret
protected

Definition at line 96 of file TargetInfo.h.

Referenced by TargetInfo().

◆ DataLayout

std::unique_ptr<llvm::DataLayout> clang::TargetInfo::DataLayout
protected

Definition at line 83 of file TargetInfo.h.

Referenced by clang::targets::AMDGPUTargetInfo::AMDGPUTargetInfo().

◆ DefaultAlignForAttributeAligned

unsigned char clang::TargetInfo::DefaultAlignForAttributeAligned
protected

Definition at line 76 of file TargetInfo.h.

Referenced by clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().

◆ DoubleAlign

unsigned char clang::TargetInfo::DoubleAlign
protected

◆ DoubleFormat

const llvm::fltSemantics * clang::TargetInfo::DoubleFormat
protected

Definition at line 85 of file TargetInfo.h.

Referenced by adjust(), and TargetInfo().

◆ DoubleWidth

unsigned char clang::TargetInfo::DoubleWidth
protected

◆ Float128Align

unsigned char clang::TargetInfo::Float128Align
protected

Definition at line 71 of file TargetInfo.h.

Referenced by TargetInfo().

◆ Float128Format

const llvm::fltSemantics * clang::TargetInfo::Float128Format
protected

Definition at line 85 of file TargetInfo.h.

Referenced by TargetInfo().

◆ FloatAlign

unsigned char clang::TargetInfo::FloatAlign
protected

◆ FloatFormat

const llvm::fltSemantics * clang::TargetInfo::FloatFormat
protected

Definition at line 85 of file TargetInfo.h.

Referenced by adjust(), and TargetInfo().

◆ FloatWidth

unsigned char clang::TargetInfo::FloatWidth
protected

◆ HalfAlign

unsigned char clang::TargetInfo::HalfAlign
protected

◆ HalfFormat

const llvm::fltSemantics* clang::TargetInfo::HalfFormat
protected

Definition at line 85 of file TargetInfo.h.

Referenced by adjust(), and TargetInfo().

◆ HalfWidth

unsigned char clang::TargetInfo::HalfWidth
protected

◆ HasAlignMac68kSupport

unsigned clang::TargetInfo::HasAlignMac68kSupport
protected

◆ HasBuiltinMSVaList

unsigned clang::TargetInfo::HasBuiltinMSVaList
protected

◆ HasFloat128

bool clang::TargetInfo::HasFloat128
protected

◆ Int64Type

IntType clang::TargetInfo::Int64Type
protected

◆ IntAlign

unsigned char clang::TargetInfo::IntAlign
protected

◆ IntMaxType

IntType clang::TargetInfo::IntMaxType
protected

◆ IntPtrType

IntType clang::TargetInfo::IntPtrType
protected

◆ IntWidth

unsigned char clang::TargetInfo::IntWidth
protected

◆ IsRenderScriptTarget

unsigned clang::TargetInfo::IsRenderScriptTarget
protected

◆ LargeArrayAlign

unsigned char clang::TargetInfo::LargeArrayAlign
protected

Definition at line 72 of file TargetInfo.h.

Referenced by TargetInfo().

◆ LargeArrayMinWidth

unsigned char clang::TargetInfo::LargeArrayMinWidth
protected

Definition at line 72 of file TargetInfo.h.

Referenced by TargetInfo().

◆ LongAlign

unsigned char clang::TargetInfo::LongAlign
protected

◆ LongDoubleAlign

unsigned char clang::TargetInfo::LongDoubleAlign
protected

◆ LongDoubleFormat

const llvm::fltSemantics * clang::TargetInfo::LongDoubleFormat
protected

◆ LongDoubleWidth

unsigned char clang::TargetInfo::LongDoubleWidth
protected

◆ LongLongAlign

unsigned char clang::TargetInfo::LongLongAlign
protected

◆ LongLongWidth

unsigned char clang::TargetInfo::LongLongWidth
protected

◆ LongWidth

unsigned char clang::TargetInfo::LongWidth
protected

◆ MaxAtomicInlineWidth

unsigned char clang::TargetInfo::MaxAtomicInlineWidth
protected

◆ MaxAtomicPromoteWidth

unsigned char clang::TargetInfo::MaxAtomicPromoteWidth
protected

◆ MaxTLSAlign

unsigned short clang::TargetInfo::MaxTLSAlign
protected

Definition at line 80 of file TargetInfo.h.

Referenced by TargetInfo().

◆ MaxVectorAlign

unsigned short clang::TargetInfo::MaxVectorAlign
protected

◆ MCountName

const char* clang::TargetInfo::MCountName
protected

◆ MinGlobalAlign

unsigned char clang::TargetInfo::MinGlobalAlign
protected

Definition at line 77 of file TargetInfo.h.

Referenced by clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().

◆ NewAlign

unsigned short clang::TargetInfo::NewAlign
protected

◆ NoAsmVariants

bool clang::TargetInfo::NoAsmVariants
protected

◆ PlatformMinVersion

VersionTuple clang::TargetInfo::PlatformMinVersion
mutableprotected

Definition at line 92 of file TargetInfo.h.

Referenced by TargetInfo().

◆ PlatformName

StringRef clang::TargetInfo::PlatformName
mutableprotected

Definition at line 91 of file TargetInfo.h.

Referenced by TargetInfo().

◆ PointerAlign

unsigned char clang::TargetInfo::PointerAlign
protected

◆ PointerWidth

unsigned char clang::TargetInfo::PointerWidth
protected

◆ ProcessIDType

IntType clang::TargetInfo::ProcessIDType
protected

Definition at line 192 of file TargetInfo.h.

Referenced by clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().

◆ PtrDiffType

IntType clang::TargetInfo::PtrDiffType
protected

◆ RealTypeUsesObjCFPRet

unsigned clang::TargetInfo::RealTypeUsesObjCFPRet
protected

Definition at line 95 of file TargetInfo.h.

Referenced by TargetInfo().

◆ RegParmMax

unsigned char clang::TargetInfo::RegParmMax
protected

Definition at line 87 of file TargetInfo.h.

Referenced by TargetInfo().

◆ SigAtomicType

IntType clang::TargetInfo::SigAtomicType
protected

Definition at line 192 of file TargetInfo.h.

Referenced by clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().

◆ SimdDefaultAlign

unsigned short clang::TargetInfo::SimdDefaultAlign
protected

Definition at line 81 of file TargetInfo.h.

Referenced by TargetInfo().

◆ SizeType

IntType clang::TargetInfo::SizeType
protected

◆ SSERegParmMax

unsigned char clang::TargetInfo::SSERegParmMax
protected

Definition at line 87 of file TargetInfo.h.

Referenced by TargetInfo().

◆ SuitableAlign

unsigned char clang::TargetInfo::SuitableAlign
protected

◆ TheCXXABI

TargetCXXABI clang::TargetInfo::TheCXXABI
protected

◆ TLSSupported

bool clang::TargetInfo::TLSSupported
protected

◆ UseAddrSpaceMapMangling

bool clang::TargetInfo::UseAddrSpaceMapMangling
protected

Specify if mangling based on address space map should be used or not for language specific address spaces.

Definition at line 226 of file TargetInfo.h.

Referenced by clang::targets::AMDGPUTargetInfo::AMDGPUTargetInfo(), clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().

◆ UseBitFieldTypeAlignment

unsigned clang::TargetInfo::UseBitFieldTypeAlignment
protected

Control whether the alignment of bit-field types is respected when laying out structures.

If true, then the alignment of the bit-field type will be used to (a) impact the alignment of the containing structure, and (b) ensure that the individual bit-field will not straddle an alignment boundary.

Definition at line 207 of file TargetInfo.h.

Referenced by clang::targets::AArch64TargetInfo::AArch64TargetInfo(), adjust(), clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().

◆ UseExplicitBitFieldAlignment

unsigned clang::TargetInfo::UseExplicitBitFieldAlignment
protected

Whether explicit bit field alignment attributes are honored.

Definition at line 218 of file TargetInfo.h.

Referenced by clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().

◆ UseSignedCharForObjCBool

unsigned clang::TargetInfo::UseSignedCharForObjCBool
protected

Whether Objective-C's built-in boolean type should be signed char.

Otherwise, when this flag is not set, the normal built-in boolean type is used.

Definition at line 200 of file TargetInfo.h.

Referenced by clang::targets::DarwinAArch64TargetInfo::DarwinAArch64TargetInfo(), clang::targets::DarwinARMTargetInfo::DarwinARMTargetInfo(), and TargetInfo().

◆ UseZeroLengthBitfieldAlignment

unsigned clang::TargetInfo::UseZeroLengthBitfieldAlignment
protected

Whether zero length bitfields (e.g., int : 0;) force alignment of the next bitfield.

If the alignment of the zero length bitfield is greater than the member that follows it, `bar', `bar' will be aligned as the type of the zero-length bitfield.

Definition at line 215 of file TargetInfo.h.

Referenced by clang::targets::AArch64TargetInfo::AArch64TargetInfo(), clang::targets::ARMTargetInfo::ARMTargetInfo(), clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().

◆ WCharType

IntType clang::TargetInfo::WCharType
protected

◆ WIntType

IntType clang::TargetInfo::WIntType
protected

Definition at line 192 of file TargetInfo.h.

Referenced by clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().

◆ ZeroLengthBitfieldBoundary

unsigned clang::TargetInfo::ZeroLengthBitfieldBoundary
protected

If non-zero, specifies a fixed alignment value for bitfields that follow zero length bitfield, regardless of the zero length bitfield type.

Definition at line 222 of file TargetInfo.h.

Referenced by clang::targets::NVPTXTargetInfo::NVPTXTargetInfo(), and TargetInfo().


The documentation for this class was generated from the following files: