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 HasBulkMemoryOpt =
false;
59 bool HasCallIndirectOverlong =
false;
60 bool HasExceptionHandling =
false;
61 bool HasExtendedConst =
false;
63 bool HasMultiMemory =
false;
64 bool HasMultivalue =
false;
65 bool HasMutableGlobals =
false;
66 bool HasNontrappingFPToInt =
false;
67 bool HasReferenceTypes =
false;
68 bool HasSignExt =
false;
69 bool HasTailCall =
false;
70 bool HasWideArithmetic =
false;
80 LargeArrayMinWidth = 128;
81 LargeArrayAlign = 128;
82 SigAtomicType = SignedLong;
83 LongDoubleWidth = LongDoubleAlign = 128;
84 LongDoubleFormat = &llvm::APFloat::IEEEquad();
85 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
88 SizeType = UnsignedLong;
89 PtrDiffType = SignedLong;
90 IntPtrType = SignedLong;
91 HasUnalignedAccess =
true;
94 StringRef getABI()
const override;
95 bool setABI(
const std::string &Name)
override;
103 static void setSIMDLevel(llvm::StringMap<bool> &Features, SIMDEnum Level,
109 const std::vector<std::string> &FeaturesVec)
const override;
110 bool hasFeature(StringRef Feature)
const final;
112 void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
113 bool Enabled)
const final;
115 bool handleTargetFeatures(std::vector<std::string> &Features,
118 bool isValidCPUName(StringRef Name)
const final;
121 bool setCPU(
const std::string &Name)
final {
return isValidCPUName(Name); }
125 BuiltinVaListKind getBuiltinVaListKind() const final {
126 return VoidPtrBuiltinVaList;
129 ArrayRef<const char *> getGCCRegNames() const final {
return {}; }
131 ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const final {
135 bool validateAsmConstraint(
const char *&Name,
136 TargetInfo::ConstraintInfo &Info)
const final {
140 std::string_view getClobbers() const final {
return ""; }
142 bool isCLZForZeroUndef() const final {
return false; }
144 bool hasInt128Type() const final {
return true; }
146 IntType getIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
148 return BitWidth == 64 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
149 : TargetInfo::getIntTypeByWidth(BitWidth, IsSigned);
152 IntType getLeastIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
154 return BitWidth == 64
155 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
156 : TargetInfo::getLeastIntTypeByWidth(BitWidth, IsSigned);
159 CallingConvCheckResult checkCallingConvention(CallingConv CC)
const override {
171 bool hasBitIntType()
const override {
return true; }
173 bool hasProtectedVisibility()
const override {
return false; }
175 void adjust(DiagnosticsEngine &Diags, LangOptions &Opts)
override;
184 if (
T.isOSEmscripten())
186 "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-f128:64-n32:64-"
189 resetDataLayout(
"e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-"
204 LongAlign = LongWidth = 64;
205 PointerAlign = PointerWidth = 64;
206 SizeType = UnsignedLong;
207 PtrDiffType = SignedLong;
208 IntPtrType = SignedLong;
209 if (
T.isOSEmscripten())
211 "e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-i128:128-f128:64-n32:64-"
214 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