14 #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_WEBASSEMBLY_H 15 #define LLVM_CLANG_LIB_BASIC_TARGETS_WEBASSEMBLY_H 19 #include "llvm/ADT/Triple.h" 20 #include "llvm/Support/Compiler.h" 33 bool HasNontrappingFPToInt;
35 bool HasExceptionHandling;
40 HasSignExt(
false), HasExceptionHandling(
false) {
43 LargeArrayMinWidth = 128;
44 LargeArrayAlign = 128;
45 SimdDefaultAlign = 128;
46 SigAtomicType = SignedLong;
47 LongDoubleWidth = LongDoubleAlign = 128;
48 LongDoubleFormat = &llvm::APFloat::IEEEquad();
49 MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
52 SizeType = UnsignedLong;
53 PtrDiffType = SignedLong;
54 IntPtrType = SignedLong;
65 const std::vector<std::string> &FeaturesVec)
const override {
66 if (CPU ==
"bleeding-edge") {
67 Features[
"simd128"] =
true;
68 Features[
"nontrapping-fptoint"] =
true;
69 Features[
"sign-ext"] =
true;
74 bool hasFeature(StringRef Feature)
const final;
76 bool handleTargetFeatures(std::vector<std::string> &Features,
79 bool isValidCPUName(StringRef Name)
const final;
82 bool setCPU(
const std::string &Name)
final {
return isValidCPUName(Name); }
87 return VoidPtrBuiltinVaList;
96 bool validateAsmConstraint(
const char *&Name,
101 const char *getClobbers()
const final {
return ""; }
103 bool isCLZForZeroUndef()
const final {
return false; }
105 bool hasInt128Type()
const final {
return true; }
107 IntType getIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
109 return BitWidth == 64 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
113 IntType getLeastIntTypeByWidth(
unsigned BitWidth,
bool IsSigned)
const final {
115 return BitWidth == 64
116 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
126 resetDataLayout(
"e-m:e-p:32:32-i64:64-n32:64-S128");
140 LongAlign = LongWidth = 64;
141 PointerAlign = PointerWidth = 64;
142 SizeType = UnsignedLong;
143 PtrDiffType = SignedLong;
144 IntPtrType = SignedLong;
145 resetDataLayout(
"e-m:e-p:64:64-i64:64-n32:64-S128");
154 #endif // LLVM_CLANG_LIB_BASIC_TARGETS_WEBASSEMBLY_H static const Builtin::Info BuiltinInfo[]
virtual IntType getLeastIntTypeByWidth(unsigned BitWidth, bool IsSigned) const
Return the smallest integer type with at least the specified width.
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...
Options for controlling the target.
WebAssembly64TargetInfo(const llvm::Triple &T, const TargetOptions &Opts)
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Concrete class used by the front-end to report problems and issues.
WebAssemblyTargetInfo(const llvm::Triple &T, const TargetOptions &)
Exposes information about the current target.
virtual bool initFeatureMap(llvm::StringMap< bool > &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector< std::string > &FeatureVec) const
Initialize the map with the default set of target features for the CPU this should include all legal ...
Defines the clang::TargetOptions class.
IntType
===-— Target Data Type Query Methods ----------------------------—===//
Dataflow Directional Tag Classes.
virtual IntType getIntTypeByWidth(unsigned BitWidth, bool IsSigned) const
Return integer type with specified width.
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
WebAssembly32TargetInfo(const llvm::Triple &T, const TargetOptions &Opts)
Defines the clang::TargetInfo interface.