class TargetInfo

Declaration

class TargetInfo : public TransferrableTargetInfo,
                   public RefCountedBase { /* full declaration omitted */ };

Description

Exposes information about the current target.

Declared at: clang/include/clang/Basic/TargetInfo.h:190

Inherits from: TransferrableTargetInfo, RefCountedBase

Member Variables

private std::shared_ptr<TargetOptions> TargetOpts
private llvm::Triple Triple
protected bool BigEndian
protected bool TLSSupported
protected bool VLASupported
protected bool NoAsmVariants
protected bool HasLegalHalfType
protected bool HasFloat128
protected bool HasFloat16
protected bool HasBFloat16
protected bool HasIbm128
protected bool HasLongDouble
protected bool HasFPReturn
protected bool HasStrictFP
protected unsigned char MaxAtomicPromoteWidth
protected unsigned char MaxAtomicInlineWidth
protected unsigned short SimdDefaultAlign
protected std::string DataLayoutString
protected const char* UserLabelPrefix
protected const char* MCountName
protected unsigned char RegParmMax
protected unsigned char SSERegParmMax
protected clang::TargetCXXABI TheCXXABI
protected const clang::LangASMap* AddrSpaceMap
protected unsigned int ProgramAddrSpace
protected llvm::StringRef PlatformName
protected llvm::VersionTuple PlatformMinVersion
protected unsigned int HasAlignMac68kSupport
protected unsigned int RealTypeUsesObjCFPRetMask
protected unsigned int ComplexLongDoubleUsesFP2Ret
protected unsigned int HasBuiltinMSVaList
protected unsigned int IsRenderScriptTarget
protected unsigned int HasAArch64SVETypes
protected unsigned int HasRISCVVTypes
protected unsigned int AllowAMDGPUUnsafeFPAtomics
protected unsigned int ARMCDECoprocMask
protected unsigned int MaxOpenCLWorkGroupSize
protected Optional<unsigned int> MaxBitIntWidth
protected Optional<llvm::Triple> DarwinTargetVariantTriple
protected bool UseAddrSpaceMapMangling
Specify if mangling based on address space map should be used or not for language specific address spaces

Inherited from TransferrableTargetInfo:

public PointerWidth
public PointerAlign
public BoolWidth
public BoolAlign
public IntWidth
public IntAlign
public HalfWidth
public HalfAlign
public BFloat16Width
public BFloat16Align
public FloatWidth
public FloatAlign
public DoubleWidth
public DoubleAlign
public LongDoubleWidth
public LongDoubleAlign
public Float128Align
public Ibm128Align
public LargeArrayMinWidth
public LargeArrayAlign
public LongWidth
public LongAlign
public LongLongWidth
public LongLongAlign
public ShortAccumWidth
public ShortAccumAlign
public AccumWidth
public AccumAlign
public LongAccumWidth
public LongAccumAlign
public ShortFractWidth
public ShortFractAlign
public FractWidth
public FractAlign
public LongFractWidth
public LongFractAlign
public PaddingOnUnsignedFixedPoint
public ShortAccumScale
public AccumScale
public LongAccumScale
public DefaultAlignForAttributeAligned
public MinGlobalAlign
public SuitableAlign
public NewAlign
public MaxVectorAlign
public MaxTLSAlign
public HalfFormat
public BFloat16Format
public FloatFormat
public DoubleFormat
public LongDoubleFormat
public Float128Format
public Ibm128Format
protected SizeType
protected IntMaxType
protected PtrDiffType
protected IntPtrType
protected WCharType
protected WIntType
protected Char16Type
protected Char32Type
protected Int64Type
protected Int16Type
protected SigAtomicType
protected ProcessIDType
protected UseSignedCharForObjCBool
protected UseBitFieldTypeAlignment
protected UseZeroLengthBitfieldAlignment
protected UseLeadingZeroLengthBitfield
protected UseExplicitBitFieldAlignment
protected ZeroLengthBitfieldBoundary
protected MaxAlignedAttribute

Method Overview

Methods

virtual char CPUSpecificManglingCharacter(
    llvm::StringRef Name) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1386

Parameters

llvm::StringRef Name

void CheckFixedPointBits() const

Declared at: clang/include/clang/Basic/TargetInfo.h:1673

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

Description

Construct a target for the given options.

Declared at: clang/include/clang/Basic/TargetInfo.h:260

Parameters

clang::DiagnosticsEngine& Diags
const std::shared_ptr<TargetOptions>& 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.

TargetInfo(const llvm::Triple& T)

Declared at: clang/include/clang/Basic/TargetInfo.h:247

Parameters

const llvm::Triple& T

virtual void adjust(
    clang::DiagnosticsEngine& Diags,
    clang::LangOptions& Opts)

Description

Set forced language options. Apply changes to the target information with respect to certain language options which change the target configuration and adjust the language based on the target options where applicable.

Declared at: clang/include/clang/Basic/TargetInfo.h:1226

Parameters

clang::DiagnosticsEngine& Diags
clang::LangOptions& Opts

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

Description

Adjust target options based on codegen options.

Declared at: clang/include/clang/Basic/TargetInfo.h:1229

Parameters

const clang::CodeGenOptions& CGOpts
clang::TargetOptions& TargetOpts

bool allowAMDGPUUnsafeFPAtomics() const

Description

Returns whether or not the AMDGPU unsafe floating point atomics are allowed.

Declared at: clang/include/clang/Basic/TargetInfo.h:963

virtual bool allowDebugInfoForExternalRef() const

Description

Whether target allows debuginfo types for decl only variables/functions.

Declared at: clang/include/clang/Basic/TargetInfo.h:1635

virtual bool allowsLargerPreferedTypeAlignment()
    const

Description

Whether target allows to overalign ABI-specified preferred alignment

Declared at: clang/include/clang/Basic/TargetInfo.h:1558

virtual bool checkArithmeticFenceSupported() const

Description

Controls if __arithmetic_fence is supported in the targeted backend.

Declared at: clang/include/clang/Basic/TargetInfo.h:1504

virtual bool checkCFProtectionBranchSupported(
    clang::DiagnosticsEngine& Diags) const

Description

Check if the target supports CFProtection branch.

Declared at: clang/include/clang/Basic/TargetInfo.h:1551

Parameters

clang::DiagnosticsEngine& Diags

virtual bool checkCFProtectionReturnSupported(
    clang::DiagnosticsEngine& Diags) const

Description

Check if the target supports CFProtection branch.

Declared at: clang/include/clang/Basic/TargetInfo.h:1555

Parameters

clang::DiagnosticsEngine& Diags

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

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:1526

Parameters

clang::CallingConv CC

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

Declared at: clang/include/clang/Basic/TargetInfo.h:1148

Parameters

const char*& Constraint

void copyAuxTarget(const clang::TargetInfo* Aux)

Description

Copy type and layout related info.

Declared at: clang/include/clang/Basic/TargetInfo.h:1654

Parameters

const clang::TargetInfo* Aux

virtual bool defaultsToAIXPowerAlignment() const

Description

Whether target defaults to the `power` alignment rules of AIX.

Declared at: clang/include/clang/Basic/TargetInfo.h:1561

bool doUnsignedFixedPointTypesHavePadding() const

Description

In the event this target uses the same number of fractional bits for its unsigned types as it does with its signed counterparts, there will be exactly one bit of padding. Return true if unsigned fixed point types have padding for this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:390

virtual void fillValidCPUList(
    SmallVectorImpl<llvm::StringRef>& Values)
    const

Description

Fill a SmallVectorImpl with the valid values to setCPU.

Declared at: clang/include/clang/Basic/TargetInfo.h:1256

Parameters

SmallVectorImpl<llvm::StringRef>& Values

virtual void fillValidTuneCPUList(
    SmallVectorImpl<llvm::StringRef>& Values)
    const

Description

Fill a SmallVectorImpl with the valid values for tuning CPU.

Declared at: clang/include/clang/Basic/TargetInfo.h:1259

Parameters

SmallVectorImpl<llvm::StringRef>& Values

virtual llvm::StringRef getABI() const

Description

Get the ABI currently in use.

Declared at: clang/include/clang/Basic/TargetInfo.h:1241

uint32_t getARMCDECoprocMask() const

Description

For ARM targets returns a mask defining which coprocessors are configured as Custom Datapath.

Declared at: clang/include/clang/Basic/TargetInfo.h:967

unsigned int getAccumAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:481

unsigned int getAccumIBits() const

Declared at: clang/include/clang/Basic/TargetInfo.h:513

unsigned int getAccumScale() const

Description

getAccumScale/IBits - Return the number of fractional/integral bits in a 'signed _Accum' type.

Declared at: clang/include/clang/Basic/TargetInfo.h:512

unsigned int getAccumWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:480

const clang::LangASMap& getAddressSpaceMap() const

Declared at: clang/include/clang/Basic/TargetInfo.h:1461

unsigned int getBFloat16Align() const

Declared at: clang/include/clang/Basic/TargetInfo.h:693

const llvm::fltSemantics& getBFloat16Format()
    const

Declared at: clang/include/clang/Basic/TargetInfo.h:694

virtual const char* getBFloat16Mangling() const

Description

Return the mangled code of bfloat.

Declared at: clang/include/clang/Basic/TargetInfo.h:735

unsigned int getBFloat16Width() const

Description

getBFloat16Width/Align/Format - Return the size/align/format of '__bf16'.

Declared at: clang/include/clang/Basic/TargetInfo.h:692

unsigned int getBoolAlign() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:445

unsigned int getBoolWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:442

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

Description

Returns the kind of __builtin_va_list type that should be used with this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:944

virtual Optional<unsigned int>
getCPUCacheLineSize() const

Declared at: clang/include/clang/Basic/TargetInfo.h:1409

virtual void getCPUSpecificCPUDispatchFeatures(
    llvm::StringRef Name,
    llvm::SmallVectorImpl<StringRef>& Features)
    const

Declared at: clang/include/clang/Basic/TargetInfo.h:1401

Parameters

llvm::StringRef Name
llvm::SmallVectorImpl<StringRef>& Features

virtual llvm::StringRef getCPUSpecificTuneName(
    llvm::StringRef Name) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1393

Parameters

llvm::StringRef Name

virtual clang::LangAS getCUDABuiltinAddressSpace(
    unsigned int AS) const

Description

Map from the address space field in builtin description strings to the language address space.

Declared at: clang/include/clang/Basic/TargetInfo.h:1471

Parameters

unsigned int AS

clang::TargetCXXABI getCXXABI() const

Description

Get the C++ ABI currently in use.

Declared at: clang/include/clang/Basic/TargetInfo.h:1244

virtual clang::TargetInfo::CallingConvKind
getCallingConvKind(bool ClangABICompat4) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1541

Parameters

bool ClangABICompat4

unsigned int getChar16Align() const

Declared at: clang/include/clang/Basic/TargetInfo.h:674

clang::TransferrableTargetInfo::IntType
getChar16Type() const

Declared at: clang/include/clang/Basic/TargetInfo.h:356

unsigned int getChar16Width() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:673

unsigned int getChar32Align() const

Declared at: clang/include/clang/Basic/TargetInfo.h:679

clang::TransferrableTargetInfo::IntType
getChar32Type() const

Declared at: clang/include/clang/Basic/TargetInfo.h:357

unsigned int getChar32Width() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:678

unsigned int getCharAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:448

unsigned int getCharWidth() const

Declared at: clang/include/clang/Basic/TargetInfo.h:447

virtual const char* getClobbers() const

Description

Returns a string of target-specific clobbers, in LLVM format.

Declared at: clang/include/clang/Basic/TargetInfo.h:1162

virtual llvm::Optional<LangAS>
getConstantAddressSpace() const

Description

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.

Declared at: clang/include/clang/Basic/TargetInfo.h:1479

virtual llvm::StringRef getConstraintRegister(
    llvm::StringRef Constraint,
    llvm::StringRef Expression) const

Description

Extracts a register from the passed constraint (if it is a single-register constraint) and the asm label expression related to a variable in the input or output list of an inline asm statement. This function is used by Sema in order to diagnose conflicts between the clobber list and the input/output lists.

Declared at: clang/include/clang/Basic/TargetInfo.h:997

Parameters

llvm::StringRef Constraint
llvm::StringRef Expression

static clang::TransferrableTargetInfo::IntType
getCorrespondingUnsignedType(
    clang::TransferrableTargetInfo::IntType T)

Declared at: clang/include/clang/Basic/TargetInfo.h:369

Parameters

clang::TransferrableTargetInfo::IntType T

virtual Optional<unsigned int>
getDWARFAddressSpace(
    unsigned int AddressSpace) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1612

Parameters

unsigned int AddressSpace

Returns

Otherwise return None and no conversion will be emitted in the DWARF.

const Optional<llvm::VersionTuple>
getDarwinTargetVariantSDKVersion() const

Description

Returns the version of the darwin target variant SDK which was used during the compilation if one was specified, or an empty version otherwise.

Declared at: clang/include/clang/Basic/TargetInfo.h:1646

const llvm::Triple* getDarwinTargetVariantTriple()
    const

Description

Returns the darwin target variant triple, the variant of the deployment target for which the code is being compiled.

Declared at: clang/include/clang/Basic/TargetInfo.h:1639

const char* getDataLayoutString() const

Declared at: clang/include/clang/Basic/TargetInfo.h:1178

unsigned int getDefaultAlignForAttributeAligned()
    const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:649

virtual clang::CallingConv getDefaultCallingConv()
    const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:1508

unsigned int getDoubleAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:698

const llvm::fltSemantics& getDoubleFormat() const

Declared at: clang/include/clang/Basic/TargetInfo.h:699

unsigned int getDoubleWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:697

virtual int getEHDataRegisterNumber(
    unsigned int RegNo) const

Description

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.

Declared at: clang/include/clang/Basic/TargetInfo.h:1452

Parameters

unsigned int RegNo

virtual unsigned int getExnObjectAlignment() const

Description

Return the alignment (in bits) of the thrown exception object. This is only meaningful for targets that allocate C++ exceptions in a system runtime, such as those using the Itanium C++ ABI.

Declared at: clang/include/clang/Basic/TargetInfo.h:782

virtual LangOptions::FPEvalMethodKind
getFPEvalMethod() const

Description

Return the value for the C99 FLT_EVAL_METHOD macro.

Declared at: clang/include/clang/Basic/TargetInfo.h:740

unsigned int getFloat128Align() const

Declared at: clang/include/clang/Basic/TargetInfo.h:712

const llvm::fltSemantics& getFloat128Format()
    const

Declared at: clang/include/clang/Basic/TargetInfo.h:713

virtual const char* getFloat128Mangling() const

Description

Return the mangled code of __float128.

Declared at: clang/include/clang/Basic/TargetInfo.h:727

unsigned int getFloat128Width() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:711

unsigned int getFloatAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:688

const llvm::fltSemantics& getFloatFormat() const

Declared at: clang/include/clang/Basic/TargetInfo.h:689

unsigned int getFloatWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:687

unsigned int getFractAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:496

unsigned int getFractScale() const

Description

getFractScale - Return the number of fractional bits in a 'signed _Fract' type.

Declared at: clang/include/clang/Basic/TargetInfo.h:560

unsigned int getFractWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:495

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

Declared at: clang/include/clang/Basic/TargetInfo.h:1666

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

Declared at: clang/include/clang/Basic/TargetInfo.h:1665

virtual ArrayRef<const char*> getGCCRegNames()
    const

Declared at: clang/include/clang/Basic/TargetInfo.h:1664

virtual const llvm::omp::GV& getGridValue() const

Declared at: clang/include/clang/Basic/TargetInfo.h:1485

unsigned int getHalfAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:683

const llvm::fltSemantics& getHalfFormat() const

Declared at: clang/include/clang/Basic/TargetInfo.h:684

unsigned int getHalfWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:682

unsigned int getIbm128Align() const

Declared at: clang/include/clang/Basic/TargetInfo.h:720

const llvm::fltSemantics& getIbm128Format() const

Declared at: clang/include/clang/Basic/TargetInfo.h:721

virtual const char* getIbm128Mangling() const

Description

Return the mangled code of __ibm128.

Declared at: clang/include/clang/Basic/TargetInfo.h:730

unsigned int getIbm128Width() const

Description

getIbm128Width/Align/Format - Return the size/align/format of '__ibm128'.

Declared at: clang/include/clang/Basic/TargetInfo.h:719

clang::TransferrableTargetInfo::IntType
getInt16Type() const

Declared at: clang/include/clang/Basic/TargetInfo.h:362

clang::TransferrableTargetInfo::IntType
getInt64Type() const

Declared at: clang/include/clang/Basic/TargetInfo.h:358

unsigned int getIntAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:461

unsigned int getIntMaxTWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:795

clang::TransferrableTargetInfo::IntType
getIntMaxType() const

Declared at: clang/include/clang/Basic/TargetInfo.h:340

clang::TransferrableTargetInfo::IntType
getIntPtrType() const

Declared at: clang/include/clang/Basic/TargetInfo.h:350

virtual clang::TransferrableTargetInfo::IntType
getIntTypeByWidth(unsigned int BitWidth,
                  bool IsSigned) const

Description

Return integer type with specified width.

Declared at: clang/include/clang/Basic/TargetInfo.h:400

Parameters

unsigned int BitWidth
bool IsSigned

unsigned int getIntWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:460

unsigned int getLargeArrayAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:749

unsigned int getLargeArrayMinWidth() const

Declared at: clang/include/clang/Basic/TargetInfo.h:748

virtual clang::TransferrableTargetInfo::IntType
getLeastIntTypeByWidth(unsigned int BitWidth,
                       bool IsSigned) const

Description

Return the smallest integer type with at least the specified width.

Declared at: clang/include/clang/Basic/TargetInfo.h:403

Parameters

unsigned int BitWidth
bool IsSigned

unsigned int getLongAccumAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:486

unsigned int getLongAccumIBits() const

Declared at: clang/include/clang/Basic/TargetInfo.h:518

unsigned int getLongAccumScale() const

Description

getLongAccumScale/IBits - Return the number of fractional/integral bits in a 'signed long _Accum' type.

Declared at: clang/include/clang/Basic/TargetInfo.h:517

unsigned int getLongAccumWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:485

unsigned int getLongAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:466

unsigned int getLongDoubleAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:704

const llvm::fltSemantics& getLongDoubleFormat()
    const

Declared at: clang/include/clang/Basic/TargetInfo.h:705

virtual const char* getLongDoubleMangling() const

Description

Return the mangled code of long double.

Declared at: clang/include/clang/Basic/TargetInfo.h:724

unsigned int getLongDoubleWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:703

unsigned int getLongFractAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:501

unsigned int getLongFractScale() const

Description

getLongFractScale - Return the number of fractional bits in a 'signed long _Fract' type.

Declared at: clang/include/clang/Basic/TargetInfo.h:564

unsigned int getLongFractWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:500

unsigned int getLongLongAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:471

unsigned int getLongLongWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:470

unsigned int getLongWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:465

const char* getMCountName() const

Description

Returns the name of the mcount instrumentation function.

Declared at: clang/include/clang/Basic/TargetInfo.h:820

unsigned int getMaxAlignedAttribute() const

Description

Get the maximum alignment in bits for a static variable with aligned attribute.

Declared at: clang/include/clang/Basic/TargetInfo.h:862

unsigned int getMaxAtomicInlineWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:756

unsigned int getMaxAtomicPromoteWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:753

virtual size_t getMaxBitIntWidth() const

Declared at: clang/include/clang/Basic/TargetInfo.h:603

unsigned int getMaxOpenCLWorkGroupSize() const

Declared at: clang/include/clang/Basic/TargetInfo.h:777

virtual uint64_t getMaxPointerWidth() const

Description

Return the maximum width of pointers on this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:433

unsigned int getMaxTLSAlign() const

Description

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.

Declared at: clang/include/clang/Basic/TargetInfo.h:1426

unsigned int getMaxVectorAlign() const

Description

Return the maximum vector alignment supported for the given target.

Declared at: clang/include/clang/Basic/TargetInfo.h:771

virtual unsigned int getMinGlobalAlign(
    uint64_t) const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:655

Parameters

uint64_t

unsigned int getNewAlign() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:662

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

Description

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".

Declared at: clang/include/clang/Basic/TargetInfo.h:986

Parameters

llvm::StringRef Name
bool ReturnCanonical = false

virtual uint64_t getNullPointerValue(
    clang::LangAS AddrSpace) const

Description

Get integer value for null pointer.

Declared at: clang/include/clang/Basic/TargetInfo.h:439

Parameters

clang::LangAS AddrSpace
address space of pointee in source language.

virtual clang::LangAS
getOpenCLBuiltinAddressSpace(
    unsigned int AS) const

Description

Map from the address space field in builtin description strings to the language address space.

Declared at: clang/include/clang/Basic/TargetInfo.h:1465

Parameters

unsigned int AS

virtual clang::LangAS getOpenCLTypeAddrSpace(
    clang::OpenCLTypeKind TK) const

Description

Get address space for OpenCL type.

Declared at: clang/include/clang/Basic/TargetInfo.h:1599

Parameters

clang::OpenCLTypeKind TK

llvm::VersionTuple getPlatformMinVersion() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:1495

llvm::StringRef getPlatformName() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:1491

uint64_t getPointerAlign(
    unsigned int AddrSpace) const

Declared at: clang/include/clang/Basic/TargetInfo.h:428

Parameters

unsigned int AddrSpace

virtual uint64_t getPointerAlignV(
    unsigned int AddrSpace) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1658

Parameters

unsigned int AddrSpace

uint64_t getPointerWidth(
    unsigned int AddrSpace) const

Description

Return the width of pointers on this target, for the specified address space.

Declared at: clang/include/clang/Basic/TargetInfo.h:425

Parameters

unsigned int AddrSpace

virtual uint64_t getPointerWidthV(
    unsigned int AddrSpace) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1655

Parameters

unsigned int AddrSpace

clang::TransferrableTargetInfo::IntType
getProcessIDType() const

Declared at: clang/include/clang/Basic/TargetInfo.h:367

unsigned int getProgramAddressSpace() const

Description

Return the address space for functions for the given target.

Declared at: clang/include/clang/Basic/TargetInfo.h:800

clang::TransferrableTargetInfo::IntType
getPtrDiffType(unsigned int AddrSpace) const

Declared at: clang/include/clang/Basic/TargetInfo.h:344

Parameters

unsigned int AddrSpace

virtual enum IntType getPtrDiffTypeV(
    unsigned int AddrSpace) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1661

Parameters

unsigned int AddrSpace

clang::FloatModeKind getRealTypeByWidth(
    unsigned int BitWidth,
    clang::FloatModeKind ExplicitType) const

Description

Return floating point type with specified width. On PPC, there are three possible types for 128-bit floating point: "PPC double-double", IEEE 754R quad precision, and "long double" (which under the covers is represented as one of those two). At this time, there is no support for an explicit "PPC double-double" type (i.e. __ibm128) so we only need to differentiate between "long double" and IEEE quad precision.

Declared at: clang/include/clang/Basic/TargetInfo.h:412

Parameters

unsigned int BitWidth
clang::FloatModeKind ExplicitType

unsigned int getRegParmMax() const

Declared at: clang/include/clang/Basic/TargetInfo.h:1412

virtual unsigned int getRegisterWidth() const

Description

Return the "preferred" register width on this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:806

const llvm::VersionTuple& getSDKVersion() const

Declared at: clang/include/clang/Basic/TargetInfo.h:1618

Returns

The version of the SDK which was used during the compilation if one was specified, or an empty version otherwise.

unsigned int getShortAccumAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:476

unsigned int getShortAccumIBits() const

Declared at: clang/include/clang/Basic/TargetInfo.h:506

unsigned int getShortAccumScale() const

Description

getShortAccumScale/IBits - Return the number of fractional/integral bits in a 'signed short _Accum' type.

Declared at: clang/include/clang/Basic/TargetInfo.h:505

unsigned int getShortAccumWidth() const

Description

getShortAccumWidth/Align - Return the size of 'signed short _Accum' and 'unsigned short _Accum' for this target, in bits.

Declared at: clang/include/clang/Basic/TargetInfo.h:475

unsigned int getShortAlign() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:456

unsigned int getShortFractAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:491

unsigned int getShortFractScale() const

Description

getShortFractScale - Return the number of fractional bits in a 'signed short _Fract' type.

Declared at: clang/include/clang/Basic/TargetInfo.h:556

unsigned int getShortFractWidth() const

Description

getShortFractWidth/Align - Return the size of 'signed short _Fract' and 'unsigned short _Fract' for this target, in bits.

Declared at: clang/include/clang/Basic/TargetInfo.h:490

unsigned int getShortWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:452

clang::TransferrableTargetInfo::IntType
getSigAtomicType() const

Declared at: clang/include/clang/Basic/TargetInfo.h:366

clang::TransferrableTargetInfo::IntType
getSignedSizeType() const

Declared at: clang/include/clang/Basic/TargetInfo.h:326

unsigned int getSimdDefaultAlign() const

Description

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.

Declared at: clang/include/clang/Basic/TargetInfo.h:775

clang::TransferrableTargetInfo::IntType
getSizeType() const

Declared at: clang/include/clang/Basic/TargetInfo.h:325

virtual const char*
getStaticInitSectionSpecifier() const

Description

Return the section to use for C++ static initialization functions.

Declared at: clang/include/clang/Basic/TargetInfo.h:1457

unsigned int getSuitableAlign() const

Description

Return the alignment that is the largest alignment ever used for any scalar/SIMD data type on the target machine you are compiling for (including types with an extended alignment requirement).

Declared at: clang/include/clang/Basic/TargetInfo.h:645

llvm::StringMap<bool>& getSupportedOpenCLOpts()

Description

Get supported OpenCL extensions and optional core features.

Declared at: clang/include/clang/Basic/TargetInfo.h:1589

const llvm::StringMap<bool>&
getSupportedOpenCLOpts() const

Description

Get const supported OpenCL extensions and optional core features.

Declared at: clang/include/clang/Basic/TargetInfo.h:1594

virtual ArrayRef<Builtin::Info>
getTargetBuiltins() const

Description

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.

Declared at: clang/include/clang/Basic/TargetInfo.h:928

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

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:921

Parameters

const clang::LangOptions& Opts
clang::MacroBuilder& Builder

virtual llvm::Optional<std::string> getTargetID()
    const

Description

Returns the target ID if supported.

Declared at: clang/include/clang/Basic/TargetInfo.h:1176

clang::TargetOptions& getTargetOpts() const

Description

Retrieve the target options.

Declared at: clang/include/clang/Basic/TargetInfo.h:266

const llvm::Triple& getTriple() const

Description

Returns the target triple of the primary target.

Declared at: clang/include/clang/Basic/TargetInfo.h:1171

unsigned int getTypeAlign(
    clang::TransferrableTargetInfo::IntType T)
    const

Description

Return the alignment (in bits) of the specified integer type enum. For example, SignedInt -> getIntAlign().

Declared at: clang/include/clang/Basic/TargetInfo.h:418

Parameters

clang::TransferrableTargetInfo::IntType T

const char* getTypeConstantSuffix(
    clang::TransferrableTargetInfo::IntType T)
    const

Description

Return the constant suffix for the specified integer type enum. For example, SignedLong -> "L".

Declared at: clang/include/clang/Basic/TargetInfo.h:883

Parameters

clang::TransferrableTargetInfo::IntType T

static const char* getTypeFormatModifier(
    clang::TransferrableTargetInfo::IntType T)

Description

Return the printf format modifier for the specified integer type enum. For example, SignedLong -> "l".

Declared at: clang/include/clang/Basic/TargetInfo.h:889

Parameters

clang::TransferrableTargetInfo::IntType T

static const char* getTypeName(
    clang::TransferrableTargetInfo::IntType T)

Description

Return the user string for the specified integer type enum. For example, SignedShort -> "short".

Declared at: clang/include/clang/Basic/TargetInfo.h:878

Parameters

clang::TransferrableTargetInfo::IntType T

unsigned int getTypeWidth(
    clang::TransferrableTargetInfo::IntType T)
    const

Description

Return the width (in bits) of the specified integer type enum. For example, SignedInt -> getIntWidth().

Declared at: clang/include/clang/Basic/TargetInfo.h:397

Parameters

clang::TransferrableTargetInfo::IntType T

clang::TransferrableTargetInfo::IntType
getUInt16Type() const

Declared at: clang/include/clang/Basic/TargetInfo.h:363

clang::TransferrableTargetInfo::IntType
getUInt64Type() const

Declared at: clang/include/clang/Basic/TargetInfo.h:359

clang::TransferrableTargetInfo::IntType
getUIntMaxType() const

Declared at: clang/include/clang/Basic/TargetInfo.h:341

clang::TransferrableTargetInfo::IntType
getUIntPtrType() const

Declared at: clang/include/clang/Basic/TargetInfo.h:351

unsigned int getUnsignedAccumIBits() const

Declared at: clang/include/clang/Basic/TargetInfo.h:538

unsigned int getUnsignedAccumScale() const

Description

getUnsignedAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned _Accum' type.

Declared at: clang/include/clang/Basic/TargetInfo.h:535

unsigned int getUnsignedFractScale() const

Description

getUnsignedFractScale - Return the number of fractional bits in a 'unsigned _Fract' type.

Declared at: clang/include/clang/Basic/TargetInfo.h:575

unsigned int getUnsignedLongAccumIBits() const

Declared at: clang/include/clang/Basic/TargetInfo.h:548

unsigned int getUnsignedLongAccumScale() const

Description

getUnsignedLongAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned long _Accum' type.

Declared at: clang/include/clang/Basic/TargetInfo.h:545

unsigned int getUnsignedLongFractScale() const

Description

getUnsignedLongFractScale - Return the number of fractional bits in a 'unsigned long _Fract' type.

Declared at: clang/include/clang/Basic/TargetInfo.h:581

clang::TransferrableTargetInfo::IntType
getUnsignedPtrDiffType(
    unsigned int AddrSpace) const

Declared at: clang/include/clang/Basic/TargetInfo.h:347

Parameters

unsigned int AddrSpace

unsigned int getUnsignedShortAccumIBits() const

Declared at: clang/include/clang/Basic/TargetInfo.h:527

unsigned int getUnsignedShortAccumScale() const

Description

getUnsignedShortAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned short _Accum' type.

Declared at: clang/include/clang/Basic/TargetInfo.h:524

unsigned int getUnsignedShortFractScale() const

Description

getUnsignedShortFractScale - Return the number of fractional bits in a 'unsigned short _Fract' type.

Declared at: clang/include/clang/Basic/TargetInfo.h:568

virtual unsigned int getUnwindWordWidth() const

Declared at: clang/include/clang/Basic/TargetInfo.h:803

const char* getUserLabelPrefix() const

Description

Returns the default value of the __USER_LABEL_PREFIX__ macro, which is the prefix given to user symbols by default.

On most platforms this is "", but it is "_" on some.

Declared at: clang/include/clang/Basic/TargetInfo.h:817

virtual Optional<
    std::pair<unsigned int, unsigned int>>
getVScaleRange(
    const clang::LangOptions& LangOpts) const

Description

Returns target-specific min and max values VScale_Range.

Declared at: clang/include/clang/Basic/TargetInfo.h:932

Parameters

const clang::LangOptions& LangOpts

virtual unsigned int getVtblPtrAddressSpace()
    const

Declared at: clang/include/clang/Basic/TargetInfo.h:1602

Returns

Target specific vtbl ptr address space.

unsigned int getWCharAlign() const

Declared at: clang/include/clang/Basic/TargetInfo.h:669

clang::TransferrableTargetInfo::IntType
getWCharType() const

Declared at: clang/include/clang/Basic/TargetInfo.h:354

unsigned int getWCharWidth() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:668

clang::TransferrableTargetInfo::IntType
getWIntType() const

Declared at: clang/include/clang/Basic/TargetInfo.h:355

unsigned int getZeroLengthBitfieldBoundary() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:856

virtual llvm::Optional<std::string>
handleAsmEscapedChar(char C) const

Description

Replace some escaped characters with another string based on target-specific rules

Declared at: clang/include/clang/Basic/TargetInfo.h:1157

Parameters

char C

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

Description

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.

Declared at: clang/include/clang/Basic/TargetInfo.h:1346

Parameters

std::vector<std::string>& Features
clang::DiagnosticsEngine& Diags

Returns

False on error.

bool hasAArch64SVETypes() const

Description

Returns whether or not the AArch64 SVE built-in types are available on this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:955

bool hasAlignMac68kSupport() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:871

virtual bool hasBFloat16Type() const

Description

Determine whether the _BFloat16 type is supported on this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:627

virtual bool hasBitIntType() const

Description

Determine whether the _BitInt type is supported on this target. This limitation is put into place for ABI reasons. FIXME: _BitInt is a required type in C23, so there's not much utility in asking whether the target supported it or not; I think this should be removed once backends have been alerted to the type and have had the chance to do implementation work if needed.

Declared at: clang/include/clang/Basic/TargetInfo.h:597

virtual bool hasBuiltinAtomic(
    uint64_t AtomicSizeInBits,
    uint64_t AlignmentInBits) const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:762

Parameters

uint64_t AtomicSizeInBits
uint64_t AlignmentInBits

bool hasBuiltinMSVaList() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:948

virtual bool hasFPReturn() const

Description

Determine whether return of a floating point value is supported on this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:637

virtual bool hasFeature(
    llvm::StringRef Feature) const

Description

Determine whether the given target has the given feature.

Declared at: clang/include/clang/Basic/TargetInfo.h:1352

Parameters

llvm::StringRef Feature

virtual bool hasFeatureEnabled(
    const llvm::StringMap<bool>& Features,
    llvm::StringRef Name) const

Description

Check if target has a given feature enabled

Declared at: clang/include/clang/Basic/TargetInfo.h:1294

Parameters

const llvm::StringMap<bool>& Features
llvm::StringRef Name

virtual bool hasFloat128Type() const

Description

Determine whether the __float128 type is supported on this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:621

virtual bool hasFloat16Type() const

Description

Determine whether the _Float16 type is supported on this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:624

virtual bool hasIbm128Type() const

Description

Determine whether the __ibm128 type is supported on this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:630

virtual bool hasInt128Type() const

Description

Determine whether the __int128 type is supported on this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:587

virtual bool hasLegalHalfType() const

Description

Determine whether _Float16 is supported on this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:618

virtual bool hasLongDoubleType() const

Description

Determine whether the long double type is supported on this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:633

bool hasNoAsmVariants() const

Description

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.

Declared at: clang/include/clang/Basic/TargetInfo.h:1444

virtual bool hasPS4DLLImportExport() const

Declared at: clang/include/clang/Basic/TargetInfo.h:1213

virtual bool hasProtectedVisibility() const

Description

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.

Declared at: clang/include/clang/Basic/TargetInfo.h:1203

bool hasRISCVVTypes() const

Description

Returns whether or not the RISC-V V built-in types are available on this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:959

virtual bool hasSjLjLowering() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:1545

virtual bool hasStrictFP() const

Description

Determine whether constrained floating point is supported on this target.

Declared at: clang/include/clang/Basic/TargetInfo.h:640

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

Description

Initialize the map with the default set of target features for the CPU this should include all legal feature strings on the target.

Declared at: clang/include/clang/Basic/TargetInfo.h:1236

Parameters

llvm::StringMap<bool>& Features
clang::DiagnosticsEngine& Diags
llvm::StringRef CPU
const std::vector<std::string>& FeatureVec

Returns

False on error (invalid features).

bool isBigEndian() const

Declared at: clang/include/clang/Basic/TargetInfo.h:1497

virtual bool isBranchProtectionSupportedArch(
    llvm::StringRef Arch) const

Description

Determine if the Architecture in this TargetInfo supports branch protection

Declared at: clang/include/clang/Basic/TargetInfo.h:1322

Parameters

llvm::StringRef Arch

virtual bool isCLZForZeroUndef() const

Description

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.

Declared at: clang/include/clang/Basic/TargetInfo.h:940

bool isLittleEndian() const

Declared at: clang/include/clang/Basic/TargetInfo.h:1498

virtual bool isNan2008() const

Description

Returns true if NaN encoding is IEEE 754-2008. Only MIPS allows a different encoding.

Declared at: clang/include/clang/Basic/TargetInfo.h:1166

bool isRenderScriptTarget() const

Description

Returns true for RenderScript.

Declared at: clang/include/clang/Basic/TargetInfo.h:951

bool isSEHTrySupported() const

Description

Whether the target supports SEH __try.

Declared at: clang/include/clang/Basic/TargetInfo.h:1432

virtual bool isSPRegName(llvm::StringRef) const

Declared at: clang/include/clang/Basic/TargetInfo.h:989

Parameters

llvm::StringRef

bool isTLSSupported() const

Description

Whether the target supports thread-local storage.

Declared at: clang/include/clang/Basic/TargetInfo.h:1418

static bool isTypeSigned(
    clang::TransferrableTargetInfo::IntType T)

Description

Returns true if the type is signed; false otherwise.

Declared at: clang/include/clang/Basic/TargetInfo.h:421

Parameters

clang::TransferrableTargetInfo::IntType T

bool isVLASupported() const

Description

Whether target supports variable-length arrays.

Declared at: clang/include/clang/Basic/TargetInfo.h:1429

virtual bool isValidCPUName(
    llvm::StringRef Name) const

Description

brief Determine whether this TargetInfo supports the given CPU name.

Declared at: clang/include/clang/Basic/TargetInfo.h:1264

Parameters

llvm::StringRef Name

bool isValidClobber(llvm::StringRef Name) const

Description

Returns whether the passed in string is a valid clobber in an inline asm statement. This is used by Sema.

Declared at: clang/include/clang/Basic/TargetInfo.h:973

Parameters

llvm::StringRef Name

virtual bool isValidFeatureName(
    llvm::StringRef Feature) const

Description

Determine whether this TargetInfo supports the given feature.

Declared at: clang/include/clang/Basic/TargetInfo.h:1308

Parameters

llvm::StringRef Feature

virtual bool isValidGCCRegisterName(
    llvm::StringRef Name) const

Description

Returns whether the passed in string is a valid register name according to GCC. This is used by Sema for inline asm statements.

Declared at: clang/include/clang/Basic/TargetInfo.h:979

Parameters

llvm::StringRef Name

virtual bool isValidTuneCPUName(
    llvm::StringRef Name) const

Description

brief Determine whether this TargetInfo supports the given CPU name for

Declared at: clang/include/clang/Basic/TargetInfo.h:1270

Parameters

llvm::StringRef Name

virtual unsigned int multiVersionSortPriority(
    llvm::StringRef Name) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1371

Parameters

llvm::StringRef Name

void noSignedCharForObjCBool()

Declared at: clang/include/clang/Basic/TargetInfo.h:832

void resetDataLayout(
    llvm::StringRef DL,
    const char* UserLabelPrefix = "")

Declared at: clang/include/clang/Basic/TargetInfo.h:251

Parameters

llvm::StringRef DL
const char* UserLabelPrefix = ""

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

Declared at: clang/include/clang/Basic/TargetInfo.h:1141

Parameters

const char*& Name
ArrayRef<clang::TargetInfo::ConstraintInfo> OutputConstraints
unsigned int& Index

virtual bool setABI(const std::string& Name)

Description

Use the specified ABI.

Declared at: clang/include/clang/Basic/TargetInfo.h:1282

Parameters

const std::string& Name

Returns

False on error (invalid ABI name).

virtual void setAuxTarget(
    const clang::TargetInfo* Aux)

Declared at: clang/include/clang/Basic/TargetInfo.h:1632

Parameters

const clang::TargetInfo* Aux

virtual bool setCPU(const std::string& Name)

Description

Target the specified CPU.

Declared at: clang/include/clang/Basic/TargetInfo.h:1251

Parameters

const std::string& Name

Returns

False on error (invalid CPU name).

virtual void setCommandLineOpenCLOpts()

Description

Set supported OpenCL extensions as written on command line

Declared at: clang/include/clang/Basic/TargetInfo.h:1573

virtual bool setFPMath(llvm::StringRef Name)

Description

Use the specified unit for FP math.

Declared at: clang/include/clang/Basic/TargetInfo.h:1289

Parameters

llvm::StringRef Name

Returns

False on error (invalid unit name).

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

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:1301

Parameters

llvm::StringMap<bool>& Features
llvm::StringRef Name
bool Enabled

virtual void setMaxAtomicWidth()

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:759

virtual void setSupportedOpenCLOpts()

Description

Set supported OpenCL extensions and optional core features.

Declared at: clang/include/clang/Basic/TargetInfo.h:1564

virtual bool shouldDLLImportComdatSymbols() const

Description

Does this target aim for semantic compatibility with Microsoft C++ code using dllimport/export attributes?

Declared at: clang/include/clang/Basic/TargetInfo.h:1207

virtual void supportAllOpenCLOpts(bool V = true)

Declared at: clang/include/clang/Basic/TargetInfo.h:1566

Parameters

bool V = true

virtual bool supportSourceEvalMethod() const

Declared at: clang/include/clang/Basic/TargetInfo.h:744

virtual bool supportsExtendIntArgs() const

Description

Whether the option -fextend-arguments={32,64} is supported on the target.

Declared at: clang/include/clang/Basic/TargetInfo.h:1501

bool supportsIFunc() const

Description

Identify whether this target supports IFuncs.

Declared at: clang/include/clang/Basic/TargetInfo.h:1361

bool supportsMultiVersioning() const

Description

Identify whether this target supports multiversioning of functions, which requires support for cpu_supports and cpu_is functionality.

Declared at: clang/include/clang/Basic/TargetInfo.h:1358

virtual bool supportsTargetAttributeTune() const

Description

brief Determine whether this TargetInfo supports tune in target attribute.

Declared at: clang/include/clang/Basic/TargetInfo.h:1275

bool useAddressSpaceMapMangling() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:913

bool useBitFieldTypeAlignment() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:838

bool useExplicitBitFieldAlignment() const

Declared at: clang/include/clang/Basic/TargetInfo.h:866

virtual bool useFP16ConversionIntrinsics() const

Description

Check whether llvm intrinsics such as llvm.convert.to.fp16 should be used to convert to and from __fp16. FIXME: This function should be removed once all targets stop using the conversion intrinsics.

Declared at: clang/include/clang/Basic/TargetInfo.h:907

bool useLeadingZeroLengthBitfield() const

Description

Check whether zero length bitfield alignment is respected if they are leading members.

Declared at: clang/include/clang/Basic/TargetInfo.h:850

bool useObjCFP2RetForComplexLongDouble() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:899

bool useObjCFPRetForRealType(
    clang::FloatModeKind T) const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:893

Parameters

clang::FloatModeKind T

bool useSignedCharForObjCBool() const

Description

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.

Declared at: clang/include/clang/Basic/TargetInfo.h:829

bool useZeroLengthBitfieldAlignment() const

Description

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

Declared at: clang/include/clang/Basic/TargetInfo.h:844

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

Declared at: clang/include/clang/Basic/TargetInfo.h:1138

Parameters

const char*& Name
TargetInfo::ConstraintInfo& info

virtual bool validateBranchProtection(
    llvm::StringRef Spec,
    llvm::StringRef Arch,
    clang::TargetInfo::BranchProtectionInfo& BPI,
    llvm::StringRef& Err) const

Description

Determine if this TargetInfo supports the given branch protection specification

Declared at: clang/include/clang/Basic/TargetInfo.h:1328

Parameters

llvm::StringRef Spec
llvm::StringRef Arch
clang::TargetInfo::BranchProtectionInfo& BPI
llvm::StringRef& Err

virtual bool validateCPUSpecificCPUDispatch(
    llvm::StringRef Name) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1381

Parameters

llvm::StringRef Name

virtual bool validateConstraintModifier(
    llvm::StringRef,
    char,
    unsigned int,
    std::string&) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1131

Parameters

llvm::StringRef
char
unsigned int
std::string&

virtual bool validateCpuIs(
    llvm::StringRef Name) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1377

Parameters

llvm::StringRef Name

virtual bool validateCpuSupports(
    llvm::StringRef Name) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1367

Parameters

llvm::StringRef Name

virtual bool validateGlobalRegisterVariable(
    llvm::StringRef RegName,
    unsigned int RegSize,
    bool& HasSizeMismatch) const

Description

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.

Declared at: clang/include/clang/Basic/TargetInfo.h:1105

Parameters

llvm::StringRef RegName
unsigned int RegSize
bool& HasSizeMismatch

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

Declared at: clang/include/clang/Basic/TargetInfo.h:1116

Parameters

MutableArrayRef<clang::TargetInfo::ConstraintInfo> OutputConstraints
clang::TargetInfo::ConstraintInfo& info

virtual bool validateInputSize(
    const llvm::StringMap<bool>& FeatureMap,
    llvm::StringRef,
    unsigned int) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1125

Parameters

const llvm::StringMap<bool>& FeatureMap
llvm::StringRef
unsigned int

virtual bool validateOpenCLTarget(
    const clang::LangOptions& Opts,
    clang::DiagnosticsEngine& Diags) const

Description

Check that OpenCL target has valid options setting based on OpenCL version.

Declared at: clang/include/clang/Basic/TargetInfo.h:1629

Parameters

const clang::LangOptions& Opts
clang::DiagnosticsEngine& Diags

bool validateOutputConstraint(
    clang::TargetInfo::ConstraintInfo& Info) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1115

Parameters

clang::TargetInfo::ConstraintInfo& Info

virtual bool validateOutputSize(
    const llvm::StringMap<bool>& FeatureMap,
    llvm::StringRef,
    unsigned int) const

Declared at: clang/include/clang/Basic/TargetInfo.h:1119

Parameters

const llvm::StringMap<bool>& FeatureMap
llvm::StringRef
unsigned int

virtual bool validateTarget(
    clang::DiagnosticsEngine& Diags) const

Description

Check the target is valid after it is fully initialized.

Declared at: clang/include/clang/Basic/TargetInfo.h:1623

Parameters

clang::DiagnosticsEngine& Diags

virtual ~TargetInfo()

Declared at: clang/include/clang/Basic/TargetInfo.h:263