13 #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_WEBASSEMBLY_H
14 #define LLVM_CLANG_LIB_BASIC_TARGETS_WEBASSEMBLY_H
18 #include "llvm/ADT/Triple.h"
19 #include "llvm/Support/Compiler.h"
33 bool HasNontrappingFPToInt =
false;
34 bool HasSignExt =
false;
35 bool HasExceptionHandling =
false;
36 bool HasBulkMemory =
false;
37 bool HasAtomics =
false;
38 bool HasMutableGlobals =
false;
39 bool HasMultivalue =
false;
40 bool HasTailCall =
false;
41 bool HasReferenceTypes =
false;
42 bool HasExtendedConst =
false;
51 LargeArrayMinWidth = 128;
52 LargeArrayAlign = 128;
53 SimdDefaultAlign = 128;
55 LongDoubleWidth = LongDoubleAlign = 128;
56 LongDoubleFormat = &llvm::APFloat::IEEEquad();
57 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
65 StringRef getABI()
const override;
73 static void setSIMDLevel(llvm::StringMap<bool> &Features, SIMDEnum
Level,
79 const std::vector<std::string> &FeaturesVec)
const override;
80 bool hasFeature(StringRef Feature)
const final;
82 void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
83 bool Enabled)
const final;
85 bool handleTargetFeatures(std::vector<std::string> &Features,
88 bool isValidCPUName(StringRef Name)
const final;
91 bool setCPU(
const std::string &Name)
final {
return isValidCPUName(Name); }
95 BuiltinVaListKind getBuiltinVaListKind() const final {
96 return VoidPtrBuiltinVaList;
99 ArrayRef<const char *> getGCCRegNames() const final {
return None; }
101 ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const final {
105 bool validateAsmConstraint(
const char *&Name,
106 TargetInfo::ConstraintInfo &Info)
const final {
110 const char *getClobbers() const final {
return ""; }
112 bool isCLZForZeroUndef() const final {
return false; }
114 bool hasInt128Type() const final {
return true; }
116 IntType getIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
118 return BitWidth == 64 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
122 IntType getLeastIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
124 return BitWidth == 64
125 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
129 CallingConvCheckResult checkCallingConvention(
CallingConv CC)
const override {
141 bool hasBitIntType()
const override {
return true; }
143 bool hasProtectedVisibility()
const override {
return false; }
145 void adjust(DiagnosticsEngine &Diags, LangOptions &Opts)
override;
154 if (T.isOSEmscripten())
155 resetDataLayout(
"e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-"
159 "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20");
173 LongAlign = LongWidth = 64;
174 PointerAlign = PointerWidth = 64;
178 if (T.isOSEmscripten())
179 resetDataLayout(
"e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-"
183 "e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20");
192 #endif // LLVM_CLANG_LIB_BASIC_TARGETS_WEBASSEMBLY_H