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;
99 static void setSIMDLevel(llvm::StringMap<bool> &Features, SIMDEnum Level,
105 const std::vector<std::string> &FeaturesVec)
const override;
106 bool hasFeature(StringRef Feature)
const final;
108 void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
109 bool Enabled)
const final;
111 bool handleTargetFeatures(std::vector<std::string> &Features,
114 bool isValidCPUName(StringRef Name)
const final;
117 bool setCPU(
const std::string &Name)
final {
return isValidCPUName(Name); }
121 BuiltinVaListKind getBuiltinVaListKind() const final {
122 return VoidPtrBuiltinVaList;
125 ArrayRef<const char *> getGCCRegNames() const final {
return std::nullopt; }
127 ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const final {
131 bool validateAsmConstraint(
const char *&Name,
132 TargetInfo::ConstraintInfo &Info)
const final {
136 std::string_view getClobbers() const final {
return ""; }
138 bool isCLZForZeroUndef() const final {
return false; }
140 bool hasInt128Type() const final {
return true; }
142 IntType getIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
144 return BitWidth == 64 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
145 : TargetInfo::getIntTypeByWidth(BitWidth, IsSigned);
148 IntType getLeastIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
150 return BitWidth == 64
151 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
152 : TargetInfo::getLeastIntTypeByWidth(BitWidth, IsSigned);
155 CallingConvCheckResult checkCallingConvention(CallingConv CC)
const override {
167 bool hasBitIntType()
const override {
return true; }
169 bool hasProtectedVisibility()
const override {
return false; }
171 void adjust(DiagnosticsEngine &Diags, LangOptions &Opts)
override;
180 if (
T.isOSEmscripten())
181 resetDataLayout(
"e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-"
185 "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20");
199 LongAlign = LongWidth = 64;
200 PointerAlign = PointerWidth = 64;
201 SizeType = UnsignedLong;
202 PtrDiffType = SignedLong;
203 IntPtrType = SignedLong;
204 if (
T.isOSEmscripten())
205 resetDataLayout(
"e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-"
209 "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