14 #ifndef LLVM_CLANG_BASIC_TARGETINFO_H 15 #define LLVM_CLANG_BASIC_TARGETINFO_H 22 #include "llvm/ADT/APInt.h" 23 #include "llvm/ADT/IntrusiveRefCntPtr.h" 24 #include "llvm/ADT/Optional.h" 25 #include "llvm/ADT/SmallSet.h" 26 #include "llvm/ADT/StringMap.h" 27 #include "llvm/ADT/StringRef.h" 28 #include "llvm/ADT/Triple.h" 29 #include "llvm/IR/DataLayout.h" 30 #include "llvm/Support/DataTypes.h" 31 #include "llvm/Support/VersionTuple.h" 41 class DiagnosticsEngine;
49 namespace Builtin {
struct Info; }
100 const llvm::fltSemantics *HalfFormat, *FloatFormat, *DoubleFormat,
126 IntType SizeType, IntMaxType, PtrDiffType, IntPtrType, WCharType,
127 WIntType, Char16Type, Char32Type, Int64Type, SigAtomicType,
163 std::shared_ptr<TargetOptions> TargetOpts;
200 DataLayout.reset(
new llvm::DataLayout(DL));
211 const std::shared_ptr<TargetOptions> &Opts);
217 assert(TargetOpts &&
"Missing target options");
225 CharPtrBuiltinVaList = 0,
277 case UnsignedLongLong:
278 return SignedLongLong;
280 llvm_unreachable(
"Invalid SizeType");
285 return getCorrespondingUnsignedType(IntMaxType);
288 return AddrSpace == 0 ? PtrDiffType : getPtrDiffTypeV(AddrSpace);
291 return getCorrespondingUnsignedType(getPtrDiffType(AddrSpace));
295 return getCorrespondingUnsignedType(IntPtrType);
303 return getCorrespondingUnsignedType(Int64Type);
313 return UnsignedShort;
319 return UnsignedLongLong;
321 llvm_unreachable(
"Unexpected signed integer type");
330 return PaddingOnUnsignedFixedPoint;
336 unsigned getTypeWidth(
IntType T)
const;
339 virtual IntType getIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const;
342 virtual IntType getLeastIntTypeByWidth(
unsigned BitWidth,
343 bool IsSigned)
const;
346 RealType getRealTypeByWidth(
unsigned BitWidth)
const;
351 unsigned getTypeAlign(
IntType T)
const;
354 static bool isTypeSigned(
IntType T);
359 return AddrSpace == 0 ? PointerWidth : getPointerWidthV(AddrSpace);
362 return AddrSpace == 0 ? PointerAlign : getPointerAlignV(AddrSpace);
440 return ShortAccumWidth - ShortAccumScale - 1;
452 return LongAccumWidth - LongAccumScale - 1;
458 return PaddingOnUnsignedFixedPoint ? ShortAccumScale : ShortAccumScale + 1;
461 return PaddingOnUnsignedFixedPoint
462 ? getShortAccumIBits()
463 : ShortAccumWidth - getUnsignedShortAccumScale();
469 return PaddingOnUnsignedFixedPoint ? AccumScale : AccumScale + 1;
472 return PaddingOnUnsignedFixedPoint ? getAccumIBits()
473 : AccumWidth - getUnsignedAccumScale();
479 return PaddingOnUnsignedFixedPoint ? LongAccumScale : LongAccumScale + 1;
482 return PaddingOnUnsignedFixedPoint
483 ? getLongAccumIBits()
484 : LongAccumWidth - getUnsignedLongAccumScale();
502 return PaddingOnUnsignedFixedPoint ? getShortFractScale()
503 : getShortFractScale() + 1;
509 return PaddingOnUnsignedFixedPoint ? getFractScale() : getFractScale() + 1;
515 return PaddingOnUnsignedFixedPoint ? getLongFractScale()
516 : getLongFractScale() + 1;
521 return (getPointerWidth(0) >= 64) || getTargetOpts().ForceEnableInt128;
540 return DefaultAlignForAttributeAligned;
546 return MinGlobalAlign;
553 return NewAlign ? NewAlign :
std::max(LongDoubleAlign, LongLongAlign);
591 return *LongDoubleFormat;
599 return *Float128Format;
628 uint64_t AlignmentInBits)
const {
629 return AtomicSizeInBits <= AlignmentInBits &&
630 AtomicSizeInBits <= getMaxAtomicInlineWidth() &&
632 llvm::isPowerOf2_64(AtomicSizeInBits /
getCharWidth()));
654 return getDefaultAlignForAttributeAligned();
659 return getTypeWidth(IntMaxType);
684 return UseSignedCharForObjCBool;
687 UseSignedCharForObjCBool =
false;
693 return UseBitFieldTypeAlignment;
699 return UseZeroLengthBitfieldAlignment;
705 return ZeroLengthBitfieldBoundary;
711 return UseExplicitBitFieldAlignment;
716 return HasAlignMac68kSupport;
727 const char *getTypeConstantSuffix(
IntType T)
const;
733 static const char *getTypeFormatModifier(
IntType T);
738 return RealTypeUsesObjCFPRet & (1 << T);
744 return ComplexLongDoubleUsesFP2Ret;
758 return UseAddrSpaceMapMangling;
765 virtual void getTargetDefines(
const LangOptions &Opts,
796 bool isValidClobber(StringRef Name)
const;
802 virtual bool isValidGCCRegisterName(StringRef Name)
const;
809 StringRef getNormalizedGCCRegisterName(StringRef Name,
810 bool ReturnCanonical =
false)
const;
819 StringRef Expression)
const {
826 CI_AllowsMemory = 0x01,
827 CI_AllowsRegister = 0x02,
829 CI_HasMatchingInput = 0x08,
830 CI_ImmediateConstant = 0x10,
831 CI_EarlyClobber = 0x20,
846 : Flags(0), TiedOperand(-1), ConstraintStr(ConstraintStr.str()),
848 ImmRange.Min = ImmRange.Max = 0;
849 ImmRange.isConstrained =
false;
853 const std::string &
getName()
const {
return Name; }
870 assert(hasTiedOperand() &&
"Has no tied operand!");
871 return (
unsigned)TiedOperand;
875 return (Flags & CI_ImmediateConstant) != 0;
879 return Value.isSignedIntN(32) &&
880 ImmSet.count(Value.getZExtValue()) != 0;
881 return !ImmRange.isConstrained ||
882 (Value.sge(ImmRange.Min) && Value.sle(ImmRange.Max));
891 Flags |= CI_ImmediateConstant;
894 ImmRange.isConstrained =
true;
897 Flags |= CI_ImmediateConstant;
898 for (
int Exact : Exacts)
899 ImmSet.insert(Exact);
902 Flags |= CI_ImmediateConstant;
903 ImmSet.insert(Exact);
906 Flags |= CI_ImmediateConstant;
915 Flags = Output.
Flags;
929 bool &HasSizeMismatch)
const {
930 HasSizeMismatch =
false;
954 std::string &)
const {
958 validateAsmConstraint(
const char *&Name,
961 bool resolveSymbolicName(
const char *&Name,
963 unsigned &Index)
const;
970 if (*Constraint ==
'p')
971 return std::string(
"r");
972 return std::string(1, *Constraint);
976 virtual const char *getClobbers()
const = 0;
990 assert(DataLayout &&
"Uninitialized DataLayout!");
995 const char *
const Aliases[5];
1000 const char *
const Names[5];
1046 virtual bool initFeatureMap(llvm::StringMap<bool> &Features,
1048 const std::vector<std::string> &FeatureVec)
const;
1051 virtual StringRef
getABI()
const {
return StringRef(); }
1061 virtual bool setCPU(
const std::string &Name) {
1076 virtual bool setABI(
const std::string &Name) {
1091 bool Enabled)
const {
1092 Features[Name] = Enabled;
1124 return getTriple().getArch() == llvm::Triple::x86 ||
1125 getTriple().getArch() == llvm::Triple::x86_64;
1154 "cpu_specific Multiversioning not implemented on this target");
1163 "cpu_specific Multiversioning not implemented on this target");
1168 assert(RegParmMax < 7 &&
"RegParmMax value is larger than AST can handle");
1174 return TLSSupported;
1190 return getTriple().isOSWindows() &&
1191 (getTriple().getArch() == llvm::Triple::x86 ||
1192 getTriple().getArch() == llvm::Triple::x86_64 ||
1193 getTriple().getArch() == llvm::Triple::aarch64);
1203 return NoAsmVariants;
1238 return LangAS::Default;
1274 return CCCR_Warning;
1286 virtual CallingConvKind getCallingConvKind(
bool ClangABICompat4)
const;
1310 for (
const auto &Ext : getTargetOpts().OpenCLExtensionsAsWritten) {
1311 getTargetOpts().SupportedOpenCLOptions.support(Ext);
1317 return getTargetOpts().SupportedOpenCLOptions;
1322 return getTargetOpts().SupportedOpenCLOptions;
1357 return getTargetOpts().SDKVersion;
1371 return PointerWidth;
1374 return PointerAlign;
1376 virtual enum IntType getPtrDiffTypeV(
unsigned AddrSpace)
const {
1388 void CheckFixedPointBits()
const;
unsigned getRegParmMax() const
TargetOptions & getTargetOpts() const
Retrieve the target options.
IntType getInt64Type() const
unsigned getHalfWidth() const
getHalfWidth/Align/Format - Return the size/align/format of 'half'.
unsigned getFloatWidth() const
getFloatWidth/Align/Format - Return the size/align/format of 'float'.
bool PaddingOnUnsignedFixedPoint
VersionTuple getPlatformMinVersion() const
Retrieve the minimum desired version of the platform, to which the program should be compiled...
unsigned getLongFractAlign() const
bool hasBuiltinMSVaList() const
Returns whether or not type __builtin_ms_va_list type is available on this target.
unsigned getLongAccumIBits() const
unsigned char LargeArrayMinWidth
The basic abstraction for the target C++ ABI.
unsigned getBoolWidth() const
Return the size of '_Bool' and C++ 'bool' for this target, in bits.
unsigned getLongWidth() const
getLongWidth/Align - Return the size of 'signed long' and 'unsigned long' for this target...
OpenCL supported extensions and optional core features.
unsigned getSuitableAlign() const
Return the alignment that is suitable for storing any object with a fundamental alignment requirement...
Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be placed into a PointerUnion...
virtual unsigned getVtblPtrAddressSpace() const
unsigned getMaxVectorAlign() const
Return the maximum vector alignment supported for the given target.
unsigned getLargeArrayAlign() const
unsigned getFloat128Align() const
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
__builtin_va_list as defined by the PNaCl ABI: http://www.chromium.org/nativeclient/pnacl/bitcode-abi...
unsigned getLongAlign() const
virtual bool isValidFeatureName(StringRef Feature) const
Determine whether this TargetInfo supports the given feature.
virtual void setMaxAtomicWidth()
Set the maximum inline or promote width lock-free atomic operation for the given target.
unsigned getDefaultAlignForAttributeAligned() const
Return the default alignment for attribute((aligned)) on this target, to be used if no alignment valu...
unsigned getFractWidth() const
getFractWidth/Align - Return the size of 'signed _Fract' and 'unsigned _Fract' for this target...
unsigned getAccumIBits() const
__builtin_va_list as defined by the x86-64 ABI: http://refspecs.linuxbase.org/elf/x86_64-abi-0.21.pdf
unsigned getCharWidth() const
virtual CallingConvCheckResult checkCallingConvention(CallingConv CC) const
Determines whether a given calling convention is valid for the target.
unsigned char ShortFractWidth
unsigned short SimdDefaultAlign
unsigned getLargeArrayMinWidth() const
llvm::SmallSet< int, 4 > ImmSet
virtual void adjustTargetOptions(const CodeGenOptions &CGOpts, TargetOptions &TargetOpts) const
Adjust target options based on codegen options.
unsigned getShortAccumIBits() const
void setRequiresImmediate(int Min, int Max)
LangAS getLangASFromTargetAS(unsigned TargetAS)
const char *const Register
Options for controlling the target.
unsigned getCharAlign() const
unsigned getWCharAlign() const
const llvm::fltSemantics & getHalfFormat() const
unsigned UseSignedCharForObjCBool
Whether Objective-C's built-in boolean type should be signed char.
LangAS
Defines the address space values used by the address space qualifier of QualType. ...
__builtin_va_list as defined by the AArch64 ABI http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055a/IHI0055A_aapcs64.pdf
virtual bool isCLZForZeroUndef() const
The __builtin_clz* and __builtin_ctz* built-in functions are specified to have undefined results for ...
bool supportsIFunc() const
Identify whether this target supports IFuncs.
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.
unsigned getAccumAlign() const
unsigned getZeroLengthBitfieldBoundary() const
Get the fixed alignment value in bits for a member that follows a zero length bitfield.
unsigned getLongDoubleAlign() const
uint64_t getPointerWidth(unsigned AddrSpace) const
Return the width of pointers on this target, for the specified address space.
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
unsigned getIntAlign() const
IntType getUnsignedPtrDiffType(unsigned AddrSpace) const
unsigned getChar32Width() const
getChar32Width/Align - Return the size of 'char32_t' for this target, in bits.
virtual bool validateConstraintModifier(StringRef, char, unsigned, std::string &) const
IntType getChar32Type() const
void setRequiresImmediate()
const std::string & getName() const
bool supportsMultiVersioning() const
Identify whether this target supports multiversioning of functions, which requires support for cpu_su...
unsigned getNewAlign() const
Return the largest alignment for which a suitably-sized allocation with '::operator new(size_t)' is g...
IntType getSizeType() const
unsigned getUnsignedLongAccumIBits() const
bool hasNoAsmVariants() const
Return true if {|} are normal characters in the asm string.
__DEVICE__ int max(int __a, int __b)
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
virtual void setOpenCLExtensionOpts()
Set supported OpenCL extensions as written on command line.
unsigned getMaxAtomicPromoteWidth() const
Return the maximum width lock-free atomic operation which will ever be supported for the given target...
virtual bool hasLegalHalfType() const
Determine whether _Float16 is supported on this target.
virtual StringRef getABI() const
Get the ABI currently in use.
virtual std::string isValidSectionSpecifier(StringRef SR) const
An optional hook that targets can implement to perform semantic checking on attribute((section("foo")...
unsigned char MaxAtomicPromoteWidth
bool hasMatchingInput() const
Return true if this output operand has a matching (tied) input operand.
const LangASMap & getAddressSpaceMap() const
unsigned char SSERegParmMax
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 alig...
virtual bool validateTarget(DiagnosticsEngine &Diags) const
Check the target is valid after it is fully initialized.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
unsigned char SuitableAlign
Concrete class used by the front-end to report problems and issues.
virtual StringRef getConstraintRegister(StringRef Constraint, StringRef Expression) const
Extracts a register from the passed constraint (if it is a single-register constraint) and the asm la...
unsigned getShortAccumScale() const
getShortAccumScale/IBits - Return the number of fractional/integral bits in a 'signed short _Accum' t...
unsigned getShortWidth() const
Return the size of 'signed short' and 'unsigned short' for this target, in bits.
unsigned getChar16Align() const
unsigned getFractAlign() const
virtual unsigned getExnObjectAlignment() const
Return the alignment (in bits) of the thrown exception object.
virtual const char * getLongDoubleMangling() const
Return the mangled code of long double.
VersionTuple PlatformMinVersion
virtual unsigned getRegisterWidth() const
Return the "preferred" register width on this target.
bool useZeroLengthBitfieldAlignment() const
Check whether zero length bitfields should force alignment of the next member.
unsigned ComplexLongDoubleUsesFP2Ret
unsigned getLongLongAlign() const
unsigned UseZeroLengthBitfieldAlignment
Whether zero length bitfields (e.g., int : 0;) force alignment of the next bitfield.
bool isSEHTrySupported() const
Whether the target supports SEH __try.
unsigned RealTypeUsesObjCFPRet
bool isLittleEndian() const
unsigned getAccumScale() const
getAccumScale/IBits - Return the number of fractional/integral bits in a 'signed _Accum' type...
Provides definitions for the various language-specific address spaces.
unsigned getLongAccumScale() const
getLongAccumScale/IBits - Return the number of fractional/integral bits in a 'signed long _Accum' typ...
bool useExplicitBitFieldAlignment() const
Check whether explicit bitfield alignment attributes should be.
const llvm::fltSemantics & getDoubleFormat() const
unsigned char DefaultAlignForAttributeAligned
const llvm::fltSemantics & getLongDoubleFormat() const
typedef void* __builtin_va_list;
unsigned HasBuiltinMSVaList
void setRequiresImmediate(int Exact)
Exposes information about the current target.
unsigned char LongFractWidth
Defines the TargetCXXABI class, which abstracts details of the C++ ABI that we're targeting...
unsigned HasAlignMac68kSupport
const char * getTypeName(ID Id)
getTypeName - Return the name of the type for Id.
unsigned getShortFractAlign() const
virtual bool hasProtectedVisibility() const
Does this target support "protected" visibility?
IntType getSignedSizeType() const
IntType getUIntPtrType() const
unsigned getIntWidth() const
getIntWidth/Align - Return the size of 'signed int' and 'unsigned int' for this target, in bits.
bool useObjCFPRetForRealType(RealType T) const
Check whether the given real type should use the "fpret" flavor of Objective-C message passing on thi...
virtual CallingConv getDefaultCallingConv() const
Gets the default calling convention for the given target and declaration context. ...
virtual bool hasSjLjLowering() const
Controls if __builtin_longjmp / __builtin_setjmp can be lowered to llvm.eh.sjlj.longjmp / llvm...
unsigned UseBitFieldTypeAlignment
Control whether the alignment of bit-field types is respected when laying out structures.
unsigned getShortAccumWidth() const
getShortAccumWidth/Align - Return the size of 'signed short _Accum' and 'unsigned short _Accum' for t...
std::string ConstraintStr
unsigned char ShortAccumScale
bool requiresImmediateConstant() const
unsigned getAccumWidth() const
getAccumWidth/Align - Return the size of 'signed _Accum' and 'unsigned _Accum' for this target...
unsigned getLongAccumWidth() const
getLongAccumWidth/Align - Return the size of 'signed long _Accum' and 'unsigned long _Accum' for this...
unsigned short getMaxTLSAlign() const
Return the maximum alignment (in bits) of a TLS variable.
IntType getChar16Type() const
virtual void fillValidCPUList(SmallVectorImpl< StringRef > &Values) const
Fill a SmallVectorImpl with the valid values to setCPU.
virtual bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags)
Perform initialization based on the user configured set of features (e.g., +sse4).
virtual bool validateCpuSupports(StringRef Name) const
virtual Optional< unsigned > getDWARFAddressSpace(unsigned AddressSpace) const
unsigned getShortAlign() const
Return the alignment of 'signed short' and 'unsigned short' for this target.
virtual void getCPUSpecificCPUDispatchFeatures(StringRef Name, llvm::SmallVectorImpl< StringRef > &Features) const
virtual bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize, bool &HasSizeMismatch) const
Validate register name used for global register variables.
void resetDataLayout(StringRef DL)
bool hasAlignMac68kSupport() const
Check whether this target support '#pragma options align=mac68k'.
unsigned getDoubleAlign() const
bool useAddressSpaceMapMangling() const
Specify if mangling based on address space map should be used or not for language specific address sp...
IntType getUIntMaxType() const
unsigned getDoubleWidth() const
getDoubleWidth/Align/Format - Return the size/align/format of 'double'.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
const llvm::fltSemantics * LongDoubleFormat
virtual bool allowsLargerPreferedTypeAlignment() const
Whether target allows to overalign ABI-specified preferred alignment.
unsigned getWCharWidth() const
getWCharWidth/Align - Return the size of 'wchar_t' for this target, in bits.
unsigned getLongAccumAlign() const
virtual bool useFP16ConversionIntrinsics() const
Check whether llvm intrinsics such as llvm.convert.to.fp16 should be used to convert to and from __fp...
const llvm::VersionTuple & getSDKVersion() const
virtual uint64_t getPointerAlignV(unsigned AddrSpace) const
IntType getPtrDiffType(unsigned AddrSpace) const
unsigned getIntMaxTWidth() const
Return the size of intmax_t and uintmax_t for this target, in bits.
IntType getSigAtomicType() const
virtual bool setABI(const std::string &Name)
Use the specified ABI.
virtual bool isNan2008() const
Returns true if NaN encoding is IEEE 754-2008.
StringRef getPlatformName() const
Retrieve the name of the platform as it is used in the availability attribute.
const LangASMap * AddrSpaceMap
unsigned getMaxAtomicInlineWidth() const
Return the maximum width lock-free atomic operation which can be inlined given the supported features...
unsigned getShortAccumAlign() const
IntType getWIntType() const
virtual const char * getFloat128Mangling() const
Return the mangled code of __float128.
unsigned IsRenderScriptTarget
unsigned char LongDoubleWidth
virtual int getEHDataRegisterNumber(unsigned RegNo) const
Return the register number that __builtin_eh_return_regno would return with the specified argument...
unsigned UseExplicitBitFieldAlignment
Whether explicit bit field alignment attributes are honored.
unsigned getChar16Width() const
getChar16Width/Align - Return the size of 'char16_t' for this target, in bits.
unsigned getLongLongWidth() const
getLongLongWidth/Align - Return the size of 'signed long long' and 'unsigned long long' for this targ...
virtual LangAS getOpenCLBuiltinAddressSpace(unsigned AS) const
Map from the address space field in builtin description strings to the language address space...
unsigned short MaxTLSAlign
unsigned getUnsignedAccumScale() const
getUnsignedAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned _Accum' ty...
IntType getIntMaxType() const
unsigned char LongAccumScale
unsigned getFloat128Width() const
getFloat128Width/Align/Format - Return the size/align/format of '__float128'.
Defines the clang::TargetOptions class.
unsigned getHalfAlign() const
virtual uint64_t getPointerWidthV(unsigned AddrSpace) const
const llvm::DataLayout & getDataLayout() const
virtual ArrayRef< AddlRegName > getGCCAddlRegNames() const
virtual unsigned getFloatEvalMethod() const
Return the value for the C99 FLT_EVAL_METHOD macro.
__builtin_va_list as defined by the Power ABI: https://www.power.org /resources/downloads/Power-Arch-...
bool useObjCFP2RetForComplexLongDouble() const
Check whether _Complex long double should use the "fp2ret" flavor of Objective-C message passing on t...
bool useBitFieldTypeAlignment() const
Check whether the alignment of bit-field types is respected when laying out structures.
IntType getUInt64Type() const
virtual bool validateCpuIs(StringRef Name) const
unsigned getUnsignedAccumIBits() const
bool isVLASupported() const
Whether target supports variable-length arrays.
bool isValidAsmImmediate(const llvm::APInt &Value) const
unsigned getLongDoubleWidth() const
getLongDoubleWidth/Align/Format - Return the size/align/format of 'long double'.
__builtin_va_list as defined by ARM AAPCS ABI http://infocenter.arm.com
unsigned getUnsignedLongAccumScale() const
getUnsignedLongAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned long _...
unsigned char PointerWidth
IntType
===-— Target Data Type Query Methods ----------------------------—===//
Defines various enumerations that describe declaration and type specifiers.
const llvm::fltSemantics & getFloat128Format() const
unsigned char LongLongWidth
unsigned getUnsignedShortAccumIBits() const
Dataflow Directional Tag Classes.
virtual unsigned getMinGlobalAlign(uint64_t) const
getMinGlobalAlign - Return the minimum alignment of a global variable, unless its alignment is explic...
unsigned ZeroLengthBitfieldBoundary
If non-zero, specifies a fixed alignment value for bitfields that follow zero length bitfield...
virtual char CPUSpecificManglingCharacter(StringRef Name) const
bool allowsMemory() const
ConstraintInfo(StringRef ConstraintStr, StringRef Name)
unsigned[(unsigned) LangAS::FirstTargetAddressSpace] LangASMap
The type of a lookup table which maps from language-specific address spaces to target-specific ones...
unsigned getLongFractScale() const
getLongFractScale - Return the number of fractional bits in a 'signed long _Fract' type...
unsigned getUnsignedFractScale() const
getUnsignedFractScale - Return the number of fractional bits in a 'unsigned _Fract' type...
bool hasTiedOperand() const
Return true if this input operand is a matching constraint that ties it to an output operand...
unsigned char MinGlobalAlign
virtual bool hasFloat16Type() const
Determine whether the _Float16 type is supported on this target.
void setHasMatchingInput()
Fields controlling how types are laid out in memory; these may need to be copied for targets like AMD...
unsigned getShortFractWidth() const
getShortFractWidth/Align - Return the size of 'signed short _Fract' and 'unsigned short _Fract' for t...
virtual bool hasFeature(StringRef Feature) const
Determine whether the given target has the given feature.
bool allowsRegister() const
const std::string & getConstraintStr() const
unsigned getUnsignedShortAccumScale() const
getUnsignedShortAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned short...
unsigned getLongFractWidth() const
getLongFractWidth/Align - Return the size of 'signed long _Fract' and 'unsigned long _Fract' for this...
virtual llvm::Optional< LangAS > getConstantAddressSpace() const
Return an AST address space which can be used opportunistically for constant global memory...
bool doUnsignedFixedPointTypesHavePadding() const
In the event this target uses the same number of fractional bits for its unsigned types as it does wi...
bool useSignedCharForObjCBool() const
Check if the Objective-C built-in boolean type should be signed char.
virtual unsigned multiVersionSortPriority(StringRef Name) const
unsigned getBoolAlign() const
Return the alignment of '_Bool' and C++ 'bool' for this target.
unsigned getTiedOperand() const
virtual const char * getStaticInitSectionSpecifier() const
Return the section to use for C++ static initialization functions.
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
virtual bool isValidCPUName(StringRef Name) const
brief Determine whether this TargetInfo supports the given CPU name.
virtual uint64_t getMaxPointerWidth() const
Return the maximum width of pointers on this target.
unsigned getShortFractScale() const
getShortFractScale - Return the number of fractional bits in a 'signed short _Fract' type...
virtual bool hasFloat128Type() const
Determine whether the __float128 type is supported on this target.
void setRequiresImmediate(llvm::ArrayRef< int > Exacts)
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
virtual bool hasInt128Type() const
Determine whether the __int128 type is supported on this target.
unsigned getUnsignedLongFractScale() const
getUnsignedLongFractScale - Return the number of fractional bits in a 'unsigned long _Fract' type...
unsigned char LongAccumWidth
static IntType getCorrespondingUnsignedType(IntType T)
unsigned getFloatAlign() const
virtual bool setCPU(const std::string &Name)
Target the specified CPU.
virtual bool validateOutputSize(StringRef, unsigned) const
unsigned getFractScale() const
getFractScale - Return the number of fractional bits in a 'signed _Fract' type.
const llvm::fltSemantics & getFloatFormat() const
bool isRenderScriptTarget() const
Returns true for RenderScript.
unsigned getUnsignedShortFractScale() const
getUnsignedShortFractScale - Return the number of fractional bits in a 'unsigned short _Fract' type...
bool isTLSSupported() const
Whether the target supports thread-local storage.
IntType getWCharType() const
unsigned char ShortAccumWidth
static unsigned getCharWidth(tok::TokenKind kind, const TargetInfo &Target)
virtual LangAS getCUDABuiltinAddressSpace(unsigned AS) const
Map from the address space field in builtin description strings to the language address space...
uint64_t getPointerAlign(unsigned AddrSpace) const
unsigned char DoubleWidth
unsigned getSimdDefaultAlign() const
Return default simd alignment for the given target.
virtual void setSupportedOpenCLOpts()
Set supported OpenCL extensions and optional core features.
IntType getIntPtrType() const
virtual void setAuxTarget(const TargetInfo *Aux)
void setTiedOperand(unsigned N, ConstraintInfo &Output)
Indicate that this is an input operand that is tied to the specified output operand.
virtual bool validateInputSize(StringRef, unsigned) const
unsigned getChar32Align() const
const OpenCLOptions & getSupportedOpenCLOpts() const
Get const supported OpenCL extensions and optional core features.
virtual bool setFPMath(StringRef Name)
Use the specified unit for FP math.
virtual uint64_t getNullPointerValue(LangAS AddrSpace) const
Get integer value for null pointer.
IntType getProcessIDType() const
std::unique_ptr< llvm::DataLayout > DataLayout
OpenCLOptions & getSupportedOpenCLOpts()
Get supported OpenCL extensions and optional core features.
const char * getMCountName() const
Returns the name of the mcount instrumentation function.
void noSignedCharForObjCBool()
virtual std::string convertConstraint(const char *&Constraint) const
bool UseAddrSpaceMapMangling
Specify if mangling based on address space map should be used or not for language specific address sp...
virtual unsigned getUnwindWordWidth() const
virtual bool validateCPUSpecificCPUDispatch(StringRef Name) const
unsigned short MaxVectorAlign