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 HasAtomics =
false;
57 bool HasBulkMemory =
false;
58 bool HasExceptionHandling =
false;
59 bool HasExtendedConst =
false;
60 bool HasHalfPrecision =
false;
61 bool HasMultiMemory =
false;
62 bool HasMultivalue =
false;
63 bool HasMutableGlobals =
false;
64 bool HasNontrappingFPToInt =
false;
65 bool HasReferenceTypes =
false;
66 bool HasSignExt =
false;
67 bool HasTailCall =
false;
77 LargeArrayMinWidth = 128;
78 LargeArrayAlign = 128;
79 SigAtomicType = SignedLong;
80 LongDoubleWidth = LongDoubleAlign = 128;
81 LongDoubleFormat = &llvm::APFloat::IEEEquad();
82 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
85 SizeType = UnsignedLong;
86 PtrDiffType = SignedLong;
87 IntPtrType = SignedLong;
88 HasUnalignedAccess =
true;
91 StringRef getABI()
const override;
92 bool setABI(
const std::string &Name)
override;
94 return !HasHalfPrecision;
102 static void setSIMDLevel(llvm::StringMap<bool> &Features, SIMDEnum Level,
108 const std::vector<std::string> &FeaturesVec)
const override;
109 bool hasFeature(StringRef Feature)
const final;
111 void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
112 bool Enabled)
const final;
114 bool handleTargetFeatures(std::vector<std::string> &Features,
117 bool isValidCPUName(StringRef Name)
const final;
120 bool setCPU(
const std::string &Name)
final {
return isValidCPUName(Name); }
124 BuiltinVaListKind getBuiltinVaListKind() const final {
125 return VoidPtrBuiltinVaList;
128 ArrayRef<const char *> getGCCRegNames() const final {
return std::nullopt; }
130 ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const final {
134 bool validateAsmConstraint(
const char *&Name,
135 TargetInfo::ConstraintInfo &Info)
const final {
139 std::string_view getClobbers() const final {
return ""; }
141 bool isCLZForZeroUndef() const final {
return false; }
143 bool hasInt128Type() const final {
return true; }
145 IntType getIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
147 return BitWidth == 64 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
148 : TargetInfo::getIntTypeByWidth(BitWidth, IsSigned);
151 IntType getLeastIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
153 return BitWidth == 64
154 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
155 : TargetInfo::getLeastIntTypeByWidth(BitWidth, IsSigned);
158 CallingConvCheckResult checkCallingConvention(CallingConv CC)
const override {
170 bool hasBitIntType()
const override {
return true; }
172 bool hasProtectedVisibility()
const override {
return false; }
174 void adjust(DiagnosticsEngine &Diags, LangOptions &Opts)
override;
183 if (
T.isOSEmscripten())
184 resetDataLayout(
"e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-"
188 "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20");
202 LongAlign = LongWidth = 64;
203 PointerAlign = PointerWidth = 64;
204 SizeType = UnsignedLong;
205 PtrDiffType = SignedLong;
206 IntPtrType = SignedLong;
207 if (
T.isOSEmscripten())
208 resetDataLayout(
"e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-"
212 "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 &)
bool useFP16ConversionIntrinsics() const override
Check whether llvm intrinsics such as llvm.convert.to.fp16 should be used to convert to and from __fp...
Defines the clang::TargetInfo interface.
static const unsigned WebAssemblyAddrSpaceMap[]
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T