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;
114 const llvm::fltSemantics *HalfFormat, *FloatFormat, *DoubleFormat,
135 DataLayout.reset(
new llvm::DataLayout(DL));
146 const std::shared_ptr<TargetOptions> &Opts);
152 assert(TargetOpts &&
"Missing target options");
183 CharPtrBuiltinVaList = 0,
221 IntType SizeType, IntMaxType, PtrDiffType, IntPtrType, WCharType,
222 WIntType, Char16Type, Char32Type, Int64Type, SigAtomicType,
267 case UnsignedLongLong:
268 return SignedLongLong;
270 llvm_unreachable(
"Invalid SizeType");
275 return getCorrespondingUnsignedType(IntMaxType);
278 return AddrSpace == 0 ? PtrDiffType : getPtrDiffTypeV(AddrSpace);
281 return getCorrespondingUnsignedType(getPtrDiffType(AddrSpace));
285 return getCorrespondingUnsignedType(IntPtrType);
293 return getCorrespondingUnsignedType(Int64Type);
303 return UnsignedShort;
309 return UnsignedLongLong;
311 llvm_unreachable(
"Unexpected signed integer type");
318 unsigned getTypeWidth(
IntType T)
const;
321 virtual IntType getIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const;
324 virtual IntType getLeastIntTypeByWidth(
unsigned BitWidth,
325 bool IsSigned)
const;
328 RealType getRealTypeByWidth(
unsigned BitWidth)
const;
333 unsigned getTypeAlign(
IntType T)
const;
336 static bool isTypeSigned(
IntType T);
341 return AddrSpace == 0 ? PointerWidth : getPointerWidthV(AddrSpace);
344 return AddrSpace == 0 ? PointerAlign : getPointerAlignV(AddrSpace);
422 return ShortAccumWidth - ShortAccumScale - 1;
434 return LongAccumWidth - LongAccumScale - 1;
440 return PaddingOnUnsignedFixedPoint ? ShortAccumScale : ShortAccumScale + 1;
443 return PaddingOnUnsignedFixedPoint
444 ? getShortAccumIBits()
445 : ShortAccumWidth - getUnsignedShortAccumScale();
451 return PaddingOnUnsignedFixedPoint ? AccumScale : AccumScale + 1;
454 return PaddingOnUnsignedFixedPoint ? getAccumIBits()
455 : AccumWidth - getUnsignedAccumScale();
461 return PaddingOnUnsignedFixedPoint ? LongAccumScale : LongAccumScale + 1;
464 return PaddingOnUnsignedFixedPoint
465 ? getLongAccumIBits()
466 : LongAccumWidth - getUnsignedLongAccumScale();
484 return PaddingOnUnsignedFixedPoint ? getShortFractScale()
485 : getShortFractScale() + 1;
491 return PaddingOnUnsignedFixedPoint ? getFractScale() : getFractScale() + 1;
497 return PaddingOnUnsignedFixedPoint ? getLongFractScale()
498 : getLongFractScale() + 1;
503 return (getPointerWidth(0) >= 64) || getTargetOpts().ForceEnableInt128;
519 return DefaultAlignForAttributeAligned;
530 return NewAlign ? NewAlign :
std::max(LongDoubleAlign, LongLongAlign);
568 return *LongDoubleFormat;
576 return *Float128Format;
603 uint64_t AlignmentInBits)
const {
604 return AtomicSizeInBits <= AlignmentInBits &&
605 AtomicSizeInBits <= getMaxAtomicInlineWidth() &&
607 llvm::isPowerOf2_64(AtomicSizeInBits /
getCharWidth()));
619 return getTypeWidth(IntMaxType);
644 return UseSignedCharForObjCBool;
647 UseSignedCharForObjCBool =
false;
653 return UseBitFieldTypeAlignment;
659 return UseZeroLengthBitfieldAlignment;
665 return ZeroLengthBitfieldBoundary;
671 return UseExplicitBitFieldAlignment;
676 return HasAlignMac68kSupport;
687 const char *getTypeConstantSuffix(
IntType T)
const;
693 static const char *getTypeFormatModifier(
IntType T);
698 return RealTypeUsesObjCFPRet & (1 << T);
704 return ComplexLongDoubleUsesFP2Ret;
718 return UseAddrSpaceMapMangling;
725 virtual void getTargetDefines(
const LangOptions &Opts,
756 bool isValidClobber(StringRef Name)
const;
762 virtual bool isValidGCCRegisterName(StringRef Name)
const;
769 StringRef getNormalizedGCCRegisterName(StringRef Name,
770 bool ReturnCanonical =
false)
const;
779 StringRef Expression)
const {
786 CI_AllowsMemory = 0x01,
787 CI_AllowsRegister = 0x02,
789 CI_HasMatchingInput = 0x08,
790 CI_ImmediateConstant = 0x10,
791 CI_EarlyClobber = 0x20,
805 : Flags(0), TiedOperand(-1), ConstraintStr(ConstraintStr.str()),
807 ImmRange.Min = ImmRange.Max = 0;
811 const std::string &
getName()
const {
return Name; }
828 assert(hasTiedOperand() &&
"Has no tied operand!");
829 return (
unsigned)TiedOperand;
833 return (Flags & CI_ImmediateConstant) != 0;
836 return (Value.sge(ImmRange.Min) && Value.sle(ImmRange.Max)) ||
837 ImmSet.count(Value.getZExtValue()) != 0;
846 Flags |= CI_ImmediateConstant;
851 Flags |= CI_ImmediateConstant;
852 for (
int Exact : Exacts)
853 ImmSet.insert(Exact);
856 Flags |= CI_ImmediateConstant;
857 ImmSet.insert(Exact);
860 Flags |= CI_ImmediateConstant;
871 Flags = Output.
Flags;
885 bool &HasSizeMismatch)
const {
886 HasSizeMismatch =
false;
910 std::string &)
const {
914 validateAsmConstraint(
const char *&Name,
917 bool resolveSymbolicName(
const char *&Name,
919 unsigned &Index)
const;
926 if (*Constraint ==
'p')
927 return std::string(
"r");
928 return std::string(1, *Constraint);
932 virtual const char *getClobbers()
const = 0;
946 assert(DataLayout &&
"Uninitialized DataLayout!");
951 const char *
const Aliases[5];
956 const char *
const Names[5];
1002 virtual bool initFeatureMap(llvm::StringMap<bool> &Features,
1004 const std::vector<std::string> &FeatureVec)
const;
1007 virtual StringRef
getABI()
const {
return StringRef(); }
1017 virtual bool setCPU(
const std::string &Name) {
1032 virtual bool setABI(
const std::string &Name) {
1047 bool Enabled)
const {
1048 Features[Name] = Enabled;
1104 "cpu_specific Multiversioning not implemented on this target");
1113 "cpu_specific Multiversioning not implemented on this target");
1118 assert(RegParmMax < 7 &&
"RegParmMax value is larger than AST can handle");
1124 return TLSSupported;
1140 return getTriple().isOSWindows() &&
1141 (getTriple().getArch() == llvm::Triple::x86 ||
1142 getTriple().getArch() == llvm::Triple::x86_64 ||
1143 getTriple().getArch() == llvm::Triple::aarch64);
1153 return NoAsmVariants;
1176 return LangAS::Default;
1218 return CCCR_Warning;
1230 virtual CallingConvKind getCallingConvKind(
bool ClangABICompat4)
const;
1254 for (
const auto &Ext : getTargetOpts().OpenCLExtensionsAsWritten) {
1255 getTargetOpts().SupportedOpenCLOptions.support(Ext);
1261 return getTargetOpts().SupportedOpenCLOptions;
1266 return getTargetOpts().SupportedOpenCLOptions;
1305 return PointerWidth;
1308 return PointerAlign;
1310 virtual enum IntType getPtrDiffTypeV(
unsigned AddrSpace)
const {
1322 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)
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
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
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...
virtual uint64_t getPointerAlignV(unsigned AddrSpace) const
virtual bool supportsMultiVersioning() const
Identify whether this taret supports multiversioning of functions, which requires support for cpu_sup...
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...
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...
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...
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)
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