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"
60 bool HasAtomics =
false;
61 bool HasBulkMemory =
false;
62 bool HasBulkMemoryOpt =
false;
63 bool HasCallIndirectOverlong =
false;
64 bool HasExceptionHandling =
false;
65 bool HasExtendedConst =
false;
68 bool HasMultiMemory =
false;
69 bool HasMultivalue =
false;
70 bool HasMutableGlobals =
false;
71 bool HasNontrappingFPToInt =
false;
72 bool HasReferenceTypes =
false;
73 bool HasSignExt =
false;
74 bool HasTailCall =
false;
75 bool HasWideArithmetic =
false;
85 LargeArrayMinWidth = 128;
86 LargeArrayAlign = 128;
87 SigAtomicType = SignedLong;
88 LongDoubleWidth = LongDoubleAlign = 128;
89 LongDoubleFormat = &llvm::APFloat::IEEEquad();
90 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
93 SizeType = UnsignedLong;
94 PtrDiffType = SignedLong;
95 IntPtrType = SignedLong;
96 HasUnalignedAccess =
true;
99 StringRef getABI()
const override;
100 bool setABI(
const std::string &Name)
override;
108 static void setSIMDLevel(llvm::StringMap<bool> &Features, SIMDEnum Level,
114 const std::vector<std::string> &FeaturesVec)
const override;
117 void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
118 bool Enabled)
const final;
120 bool handleTargetFeatures(std::vector<std::string> &Features,
123 bool isValidCPUName(StringRef Name)
const final;
126 bool setCPU(
const std::string &Name)
final {
return isValidCPUName(Name); }
130 BuiltinVaListKind getBuiltinVaListKind() const final {
131 return VoidPtrBuiltinVaList;
134 ArrayRef<const char *> getGCCRegNames() const final {
return {}; }
136 ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const final {
140 bool validateAsmConstraint(
const char *&Name,
141 TargetInfo::ConstraintInfo &Info)
const final {
145 std::string_view getClobbers() const final {
return ""; }
147 bool isCLZForZeroUndef() const final {
return false; }
149 bool hasInt128Type() const final {
return true; }
151 IntType getIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
153 return BitWidth == 64 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
154 : TargetInfo::getIntTypeByWidth(BitWidth, IsSigned);
157 IntType getLeastIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
159 return BitWidth == 64
160 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
161 : TargetInfo::getLeastIntTypeByWidth(BitWidth, IsSigned);
164 CallingConvCheckResult checkCallingConvention(CallingConv CC)
const override {
176 bool hasBitIntType()
const override {
return true; }
178 bool hasProtectedVisibility()
const override {
return false; }
180 void adjust(DiagnosticsEngine &Diags, LangOptions &Opts,
181 const TargetInfo *Aux)
override;
190 if (
T.isOSEmscripten())
192 "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-f128:64-n32:64-"
195 resetDataLayout(
"e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-"
210 LongAlign = LongWidth = 64;
211 PointerAlign = PointerWidth = 64;
212 SizeType = UnsignedLong;
213 PtrDiffType = SignedLong;
214 IntPtrType = SignedLong;
215 if (
T.isOSEmscripten())
217 "e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-i128:128-f128:64-n32:64-"
220 resetDataLayout(
"e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-"
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