15 #ifndef LLVM_CLANG_BASIC_TARGETINFO_H 16 #define LLVM_CLANG_BASIC_TARGETINFO_H 23 #include "llvm/ADT/APInt.h" 24 #include "llvm/ADT/IntrusiveRefCntPtr.h" 25 #include "llvm/ADT/Optional.h" 26 #include "llvm/ADT/SmallSet.h" 27 #include "llvm/ADT/StringMap.h" 28 #include "llvm/ADT/StringRef.h" 29 #include "llvm/ADT/Triple.h" 30 #include "llvm/IR/DataLayout.h" 31 #include "llvm/Support/DataTypes.h" 32 #include "llvm/Support/VersionTuple.h" 42 class DiagnosticsEngine;
50 namespace Builtin {
struct Info; }
55 std::shared_ptr<TargetOptions> TargetOpts;
115 const llvm::fltSemantics *HalfFormat, *FloatFormat, *DoubleFormat,
136 DataLayout.reset(
new llvm::DataLayout(DL));
147 const std::shared_ptr<TargetOptions> &Opts);
153 assert(TargetOpts &&
"Missing target options");
184 CharPtrBuiltinVaList = 0,
222 IntType SizeType, IntMaxType, PtrDiffType, IntPtrType, WCharType,
223 WIntType, Char16Type, Char32Type, Int64Type, SigAtomicType,
268 case UnsignedLongLong:
269 return SignedLongLong;
271 llvm_unreachable(
"Invalid SizeType");
276 return getCorrespondingUnsignedType(IntMaxType);
279 return AddrSpace == 0 ? PtrDiffType : getPtrDiffTypeV(AddrSpace);
282 return getCorrespondingUnsignedType(getPtrDiffType(AddrSpace));
286 return getCorrespondingUnsignedType(IntPtrType);
294 return getCorrespondingUnsignedType(Int64Type);
304 return UnsignedShort;
310 return UnsignedLongLong;
312 llvm_unreachable(
"Unexpected signed integer type");
321 return PaddingOnUnsignedFixedPoint;
327 unsigned getTypeWidth(
IntType T)
const;
330 virtual IntType getIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const;
333 virtual IntType getLeastIntTypeByWidth(
unsigned BitWidth,
334 bool IsSigned)
const;
337 RealType getRealTypeByWidth(
unsigned BitWidth)
const;
342 unsigned getTypeAlign(
IntType T)
const;
345 static bool isTypeSigned(
IntType T);
350 return AddrSpace == 0 ? PointerWidth : getPointerWidthV(AddrSpace);
353 return AddrSpace == 0 ? PointerAlign : getPointerAlignV(AddrSpace);
431 return ShortAccumWidth - ShortAccumScale - 1;
443 return LongAccumWidth - LongAccumScale - 1;
449 return PaddingOnUnsignedFixedPoint ? ShortAccumScale : ShortAccumScale + 1;
452 return PaddingOnUnsignedFixedPoint
453 ? getShortAccumIBits()
454 : ShortAccumWidth - getUnsignedShortAccumScale();
460 return PaddingOnUnsignedFixedPoint ? AccumScale : AccumScale + 1;
463 return PaddingOnUnsignedFixedPoint ? getAccumIBits()
464 : AccumWidth - getUnsignedAccumScale();
470 return PaddingOnUnsignedFixedPoint ? LongAccumScale : LongAccumScale + 1;
473 return PaddingOnUnsignedFixedPoint
474 ? getLongAccumIBits()
475 : LongAccumWidth - getUnsignedLongAccumScale();
493 return PaddingOnUnsignedFixedPoint ? getShortFractScale()
494 : getShortFractScale() + 1;
500 return PaddingOnUnsignedFixedPoint ? getFractScale() : getFractScale() + 1;
506 return PaddingOnUnsignedFixedPoint ? getLongFractScale()
507 : getLongFractScale() + 1;
512 return (getPointerWidth(0) >= 64) || getTargetOpts().ForceEnableInt128;
531 return DefaultAlignForAttributeAligned;
542 return NewAlign ? NewAlign :
std::max(LongDoubleAlign, LongLongAlign);
580 return *LongDoubleFormat;
588 return *Float128Format;
615 uint64_t AlignmentInBits)
const {
616 return AtomicSizeInBits <= AlignmentInBits &&
617 AtomicSizeInBits <= getMaxAtomicInlineWidth() &&
619 llvm::isPowerOf2_64(AtomicSizeInBits /
getCharWidth()));
631 return getTypeWidth(IntMaxType);
656 return UseSignedCharForObjCBool;
659 UseSignedCharForObjCBool =
false;
665 return UseBitFieldTypeAlignment;
671 return UseZeroLengthBitfieldAlignment;
677 return ZeroLengthBitfieldBoundary;
683 return UseExplicitBitFieldAlignment;
688 return HasAlignMac68kSupport;
699 const char *getTypeConstantSuffix(
IntType T)
const;
705 static const char *getTypeFormatModifier(
IntType T);
710 return RealTypeUsesObjCFPRet & (1 << T);
716 return ComplexLongDoubleUsesFP2Ret;
730 return UseAddrSpaceMapMangling;
737 virtual void getTargetDefines(
const LangOptions &Opts,
768 bool isValidClobber(StringRef Name)
const;
774 virtual bool isValidGCCRegisterName(StringRef Name)
const;
781 StringRef getNormalizedGCCRegisterName(StringRef Name,
782 bool ReturnCanonical =
false)
const;
791 StringRef Expression)
const {
798 CI_AllowsMemory = 0x01,
799 CI_AllowsRegister = 0x02,
801 CI_HasMatchingInput = 0x08,
802 CI_ImmediateConstant = 0x10,
803 CI_EarlyClobber = 0x20,
817 : Flags(0), TiedOperand(-1), ConstraintStr(ConstraintStr.
str()),
819 ImmRange.Min = ImmRange.Max = 0;
823 const std::string &
getName()
const {
return Name; }
840 assert(hasTiedOperand() &&
"Has no tied operand!");
841 return (
unsigned)TiedOperand;
845 return (Flags & CI_ImmediateConstant) != 0;
848 return (Value.sge(ImmRange.Min) && Value.sle(ImmRange.Max)) ||
849 ImmSet.count(Value.getZExtValue()) != 0;
858 Flags |= CI_ImmediateConstant;
863 Flags |= CI_ImmediateConstant;
864 for (
int Exact : Exacts)
865 ImmSet.insert(Exact);
868 Flags |= CI_ImmediateConstant;
869 ImmSet.insert(Exact);
872 Flags |= CI_ImmediateConstant;
883 Flags = Output.
Flags;
897 bool &HasSizeMismatch)
const {
898 HasSizeMismatch =
false;
922 std::string &)
const {
926 validateAsmConstraint(
const char *&Name,
929 bool resolveSymbolicName(
const char *&Name,
931 unsigned &Index)
const;
938 if (*Constraint ==
'p')
939 return std::string(
"r");
940 return std::string(1, *Constraint);
944 virtual const char *getClobbers()
const = 0;
958 assert(DataLayout &&
"Uninitialized DataLayout!");
963 const char *
const Aliases[5];
968 const char *
const Names[5];
1014 virtual bool initFeatureMap(llvm::StringMap<bool> &Features,
1016 const std::vector<std::string> &FeatureVec)
const;
1019 virtual StringRef
getABI()
const {
return StringRef(); }
1029 virtual bool setCPU(
const std::string &Name) {
1044 virtual bool setABI(
const std::string &Name) {
1059 bool Enabled)
const {
1060 Features[Name] = Enabled;
1092 return getTriple().getArch() == llvm::Triple::x86 ||
1093 getTriple().getArch() == llvm::Triple::x86_64;
1122 "cpu_specific Multiversioning not implemented on this target");
1131 "cpu_specific Multiversioning not implemented on this target");
1136 assert(RegParmMax < 7 &&
"RegParmMax value is larger than AST can handle");
1142 return TLSSupported;
1158 return getTriple().isOSWindows() &&
1159 (getTriple().getArch() == llvm::Triple::x86 ||
1160 getTriple().getArch() == llvm::Triple::x86_64 ||
1161 getTriple().getArch() == llvm::Triple::aarch64);
1171 return NoAsmVariants;
1206 return LangAS::Default;
1248 return CCCR_Warning;
1260 virtual CallingConvKind getCallingConvKind(
bool ClangABICompat4)
const;
1284 for (
const auto &Ext : getTargetOpts().OpenCLExtensionsAsWritten) {
1285 getTargetOpts().SupportedOpenCLOptions.support(Ext);
1291 return getTargetOpts().SupportedOpenCLOptions;
1296 return getTargetOpts().SupportedOpenCLOptions;
1331 return getTargetOpts().SDKVersion;
1341 return PointerWidth;
1344 return PointerAlign;
1346 virtual enum IntType getPtrDiffTypeV(
unsigned AddrSpace)
const {
1358 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'.
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
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...
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
virtual unsigned getVtblPtrAddressSpace() const
unsigned getMaxVectorAlign() const
Return the maximum vector alignment supported for the given target.
unsigned short MaxVectorAlign
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 char LongLongWidth
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
unsigned char ShortFractWidth
virtual CallingConvCheckResult checkCallingConvention(CallingConv CC) const
Determines whether a given calling convention is valid for the target.
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
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 ...
unsigned char LongDoubleWidth
unsigned char LargeArrayMinWidth
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 ZeroLengthBitfieldBoundary
If non-zero, specifies a fixed alignment value for bitfields that follow zero length bitfield...
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.
unsigned char MinGlobalAlign
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...
virtual bool useFloat128ManglingForLongDouble() const
Return true if the 'long double' type should be mangled like __float128.
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.
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.
unsigned char DefaultAlignForAttributeAligned
const LangASMap & getAddressSpaceMap() const
unsigned char PointerWidth
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...
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
unsigned char DoubleWidth
VersionTuple PlatformMinVersion
unsigned char ShortAccumScale
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
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...
unsigned getMinGlobalAlign() const
getMinGlobalAlign - Return the minimum alignment of a global variable, unless its alignment is explic...
unsigned char LongAccumWidth
bool useExplicitBitFieldAlignment() const
Check whether explicit bitfield alignment attributes should be.
const llvm::fltSemantics & getDoubleFormat() const
const llvm::fltSemantics & getLongDoubleFormat() const
typedef void* __builtin_va_list;
unsigned HasBuiltinMSVaList
void setRequiresImmediate(int Exact)
Exposes information about the current target.
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...
unsigned char LongFractWidth
virtual bool hasSjLjLowering() const
Controls if __builtin_longjmp / __builtin_setjmp can be lowered to llvm.eh.sjlj.longjmp / llvm...
unsigned getShortAccumWidth() const
getShortAccumWidth/Align - Return the size of 'signed short _Accum' and 'unsigned short _Accum' for t...
std::string ConstraintStr
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.
virtual bool allowsLargerPreferedTypeAlignment() const
Whether target allows to overalign ABI-specified preferred alignment.
unsigned UseExplicitBitFieldAlignment
Whether explicit bit field alignment attributes are honored.
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
unsigned IsRenderScriptTarget
virtual int getEHDataRegisterNumber(unsigned RegNo) const
Return the register number that __builtin_eh_return_regno would return with the specified argument...
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 getUnsignedAccumScale() const
getUnsignedAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned _Accum' ty...
IntType getIntMaxType() const
unsigned getFloat128Width() const
getFloat128Width/Align/Format - Return the size/align/format of '__float128'.
Defines the clang::TargetOptions class.
unsigned getHalfAlign() const
bool PaddingOnUnsignedFixedPoint
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
unsigned UseZeroLengthBitfieldAlignment
Whether zero length bitfields (e.g., int : 0;) force alignment of the next bitfield.
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 char SuitableAlign
unsigned getUnsignedLongAccumScale() const
getUnsignedLongAccumScale/IBits - Return the number of fractional/integral bits in a 'unsigned long _...
Defines various enumerations that describe declaration and type specifiers.
const llvm::fltSemantics & getFloat128Format() const
IntType
===-— Target Data Type Query Methods ----------------------------—===//
unsigned getUnsignedShortAccumIBits() const
Dataflow Directional Tag Classes.
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 char LongAccumScale
unsigned getUnsignedFractScale() const
getUnsignedFractScale - Return the number of fractional bits in a 'unsigned _Fract' type...
unsigned UseSignedCharForObjCBool
Whether Objective-C's built-in boolean type should be signed char.
bool hasTiedOperand() const
Return true if this input operand is a matching constraint that ties it to an output operand...
virtual bool hasFloat16Type() const
Determine whether the _Float16 type is supported on this target.
void setHasMatchingInput()
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...
unsigned char ShortAccumWidth
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.
virtual CallingConv getDefaultCallingConv(CallingConvMethodType MT) const
Gets the default calling convention for the given target and declaration context. ...
unsigned getUnsignedLongFractScale() const
getUnsignedLongFractScale - Return the number of fractional bits in a 'unsigned long _Fract' type...
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
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 getSimdDefaultAlign() const
Return default simd alignment for the given target.
__DEVICE__ int max(int __a, int __b)
const llvm::fltSemantics * LongDoubleFormat
virtual void setSupportedOpenCLOpts()
Set supported OpenCL extensions and optional core features.
IntType getIntPtrType() const
void setTiedOperand(unsigned N, ConstraintInfo &Output)
Indicate that this is an input operand that is tied to the specified output operand.
unsigned short MaxTLSAlign
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.
unsigned UseBitFieldTypeAlignment
Control whether the alignment of bit-field types is respected when laying out structures.
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