13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_WEBASSEMBLY_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_WEBASSEMBLY_H
18#include "llvm/Support/Compiler.h"
19#include "llvm/TargetParser/Triple.h"
56 bool HasNontrappingFPToInt =
false;
57 bool HasSignExt =
false;
58 bool HasExceptionHandling =
false;
59 bool HasBulkMemory =
false;
60 bool HasAtomics =
false;
61 bool HasMutableGlobals =
false;
62 bool HasMultivalue =
false;
63 bool HasTailCall =
false;
64 bool HasReferenceTypes =
false;
65 bool HasExtendedConst =
false;
66 bool HasMultiMemory =
false;
76 LargeArrayMinWidth = 128;
77 LargeArrayAlign = 128;
78 SigAtomicType = SignedLong;
79 LongDoubleWidth = LongDoubleAlign = 128;
80 LongDoubleFormat = &llvm::APFloat::IEEEquad();
81 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
84 SizeType = UnsignedLong;
85 PtrDiffType = SignedLong;
86 IntPtrType = SignedLong;
87 HasUnalignedAccess =
true;
90 StringRef getABI()
const override;
91 bool setABI(
const std::string &Name)
override;
98 static void setSIMDLevel(llvm::StringMap<bool> &Features, SIMDEnum Level,
104 const std::vector<std::string> &FeaturesVec)
const override;
105 bool hasFeature(StringRef Feature)
const final;
107 void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
108 bool Enabled)
const final;
110 bool handleTargetFeatures(std::vector<std::string> &Features,
113 bool isValidCPUName(StringRef Name)
const final;
116 bool setCPU(
const std::string &Name)
final {
return isValidCPUName(Name); }
120 BuiltinVaListKind getBuiltinVaListKind() const final {
121 return VoidPtrBuiltinVaList;
124 ArrayRef<const char *> getGCCRegNames() const final {
return std::nullopt; }
126 ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const final {
130 bool validateAsmConstraint(
const char *&Name,
131 TargetInfo::ConstraintInfo &Info)
const final {
135 std::string_view getClobbers() const final {
return ""; }
137 bool isCLZForZeroUndef() const final {
return false; }
139 bool hasInt128Type() const final {
return true; }
141 IntType getIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
143 return BitWidth == 64 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
144 : TargetInfo::getIntTypeByWidth(BitWidth, IsSigned);
147 IntType getLeastIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
149 return BitWidth == 64
150 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
151 : TargetInfo::getLeastIntTypeByWidth(BitWidth, IsSigned);
154 CallingConvCheckResult checkCallingConvention(CallingConv CC)
const override {
166 bool hasBitIntType()
const override {
return true; }
168 bool hasProtectedVisibility()
const override {
return false; }
170 void adjust(DiagnosticsEngine &Diags, LangOptions &Opts)
override;
179 if (
T.isOSEmscripten())
180 resetDataLayout(
"e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-"
184 "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20");
198 LongAlign = LongWidth = 64;
199 PointerAlign = PointerWidth = 64;
200 SizeType = UnsignedLong;
201 PtrDiffType = SignedLong;
202 IntPtrType = SignedLong;
203 if (
T.isOSEmscripten())
204 resetDataLayout(
"e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-"
208 "e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20");
static bool hasFeature(StringRef Feature, const LangOptions &LangOpts, const TargetInfo &Target)
Determine whether a translation unit built using the current language options has the given feature.
Defines the clang::TargetOptions class.
Concrete class used by the front-end to report problems and issues.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Exposes information about the current target.
Options for controlling the target.
WebAssembly32TargetInfo(const llvm::Triple &T, const TargetOptions &Opts)
WebAssembly64TargetInfo(const llvm::Triple &T, const TargetOptions &Opts)
WebAssemblyTargetInfo(const llvm::Triple &T, const TargetOptions &)
Defines the clang::TargetInfo interface.
static const unsigned WebAssemblyAddrSpaceMap[]
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T