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;
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;
100 static void setSIMDLevel(llvm::StringMap<bool> &Features, SIMDEnum Level,
106 const std::vector<std::string> &FeaturesVec)
const override;
107 bool hasFeature(StringRef Feature)
const final;
109 void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
110 bool Enabled)
const final;
112 bool handleTargetFeatures(std::vector<std::string> &Features,
115 bool isValidCPUName(StringRef Name)
const final;
118 bool setCPU(
const std::string &Name)
final {
return isValidCPUName(Name); }
122 BuiltinVaListKind getBuiltinVaListKind() const final {
123 return VoidPtrBuiltinVaList;
126 ArrayRef<const char *> getGCCRegNames() const final {
return std::nullopt; }
128 ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const final {
132 bool validateAsmConstraint(
const char *&Name,
133 TargetInfo::ConstraintInfo &Info)
const final {
137 std::string_view getClobbers() const final {
return ""; }
139 bool isCLZForZeroUndef() const final {
return false; }
141 bool hasInt128Type() const final {
return true; }
143 IntType getIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
145 return BitWidth == 64 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
146 : TargetInfo::getIntTypeByWidth(BitWidth, IsSigned);
149 IntType getLeastIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
151 return BitWidth == 64
152 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
153 : TargetInfo::getLeastIntTypeByWidth(BitWidth, IsSigned);
156 CallingConvCheckResult checkCallingConvention(CallingConv CC)
const override {
168 bool hasBitIntType()
const override {
return true; }
170 bool hasProtectedVisibility()
const override {
return false; }
172 void adjust(DiagnosticsEngine &Diags, LangOptions &Opts)
override;
181 if (
T.isOSEmscripten())
182 resetDataLayout(
"e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-"
186 "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20");
200 LongAlign = LongWidth = 64;
201 PointerAlign = PointerWidth = 64;
202 SizeType = UnsignedLong;
203 PtrDiffType = SignedLong;
204 IntPtrType = SignedLong;
205 if (
T.isOSEmscripten())
206 resetDataLayout(
"e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-"
210 "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