13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_WEBASSEMBLY_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_WEBASSEMBLY_H
18#include "llvm/ADT/Triple.h"
19#include "llvm/Support/Compiler.h"
32 bool HasNontrappingFPToInt =
false;
33 bool HasSignExt =
false;
34 bool HasExceptionHandling =
false;
35 bool HasBulkMemory =
false;
36 bool HasAtomics =
false;
37 bool HasMutableGlobals =
false;
38 bool HasMultivalue =
false;
39 bool HasTailCall =
false;
40 bool HasReferenceTypes =
false;
41 bool HasExtendedConst =
false;
50 LargeArrayMinWidth = 128;
51 LargeArrayAlign = 128;
52 SimdDefaultAlign = 128;
53 SigAtomicType = SignedLong;
54 LongDoubleWidth = LongDoubleAlign = 128;
55 LongDoubleFormat = &llvm::APFloat::IEEEquad();
56 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
59 SizeType = UnsignedLong;
60 PtrDiffType = SignedLong;
61 IntPtrType = SignedLong;
64 StringRef getABI()
const override;
65 bool setABI(
const std::string &Name)
override;
72 static void setSIMDLevel(llvm::StringMap<bool> &Features, SIMDEnum Level,
78 const std::vector<std::string> &FeaturesVec)
const override;
79 bool hasFeature(StringRef Feature)
const final;
81 void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
82 bool Enabled)
const final;
84 bool handleTargetFeatures(std::vector<std::string> &Features,
87 bool isValidCPUName(StringRef Name)
const final;
90 bool setCPU(
const std::string &Name)
final {
return isValidCPUName(Name); }
94 BuiltinVaListKind getBuiltinVaListKind() const final {
95 return VoidPtrBuiltinVaList;
98 ArrayRef<const char *> getGCCRegNames() const final {
return std::nullopt; }
100 ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const final {
104 bool validateAsmConstraint(
const char *&Name,
105 TargetInfo::ConstraintInfo &Info)
const final {
109 const char *getClobbers() const final {
return ""; }
111 bool isCLZForZeroUndef() const final {
return false; }
113 bool hasInt128Type() const final {
return true; }
115 IntType getIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
117 return BitWidth == 64 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
118 : TargetInfo::getIntTypeByWidth(BitWidth, IsSigned);
121 IntType getLeastIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
123 return BitWidth == 64
124 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
125 : TargetInfo::getLeastIntTypeByWidth(BitWidth, IsSigned);
128 CallingConvCheckResult checkCallingConvention(CallingConv CC)
const override {
140 bool hasBitIntType()
const override {
return true; }
142 bool hasProtectedVisibility()
const override {
return false; }
144 void adjust(DiagnosticsEngine &Diags, LangOptions &Opts)
override;
153 if (T.isOSEmscripten())
154 resetDataLayout(
"e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-"
158 "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128-ni:1:10:20");
172 LongAlign = LongWidth = 64;
173 PointerAlign = PointerWidth = 64;
174 SizeType = UnsignedLong;
175 PtrDiffType = SignedLong;
176 IntPtrType = SignedLong;
177 if (T.isOSEmscripten())
178 resetDataLayout(
"e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-"
182 "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.