class WebAssemblyTargetInfo

Declaration

class WebAssemblyTargetInfo : public TargetInfo { /* full declaration omitted */ };

Description

Exposes information about the current target.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:24

Inherits from: TargetInfo

Member Variables

private enum SIMDEnum SIMDLevel = NoSIMD
private bool HasNontrappingFPToInt = false
private bool HasSignExt = false
private bool HasExceptionHandling = false
private bool HasBulkMemory = false
private bool HasAtomics = false
private bool HasMutableGlobals = false
private bool HasMultivalue = false
private bool HasTailCall = false
private bool HasReferenceTypes = false
private bool HasExtendedConst = false
private std::string ABI
private static const Builtin::Info[] BuiltinInfo

Inherited from TargetInfo:

protected BigEndian
protected TLSSupported
protected VLASupported
protected NoAsmVariants
protected HasLegalHalfType
protected HasFloat128
protected HasFloat16
protected HasBFloat16
protected HasIbm128
protected HasLongDouble
protected HasFPReturn
protected HasStrictFP
protected MaxAtomicPromoteWidth
protected MaxAtomicInlineWidth
protected SimdDefaultAlign
protected DataLayoutString
protected UserLabelPrefix
protected MCountName
protected RegParmMax
protected SSERegParmMax
protected TheCXXABI
protected AddrSpaceMap
protected ProgramAddrSpace
protected PlatformName
protected PlatformMinVersion
protected HasAlignMac68kSupport
protected RealTypeUsesObjCFPRetMask
protected ComplexLongDoubleUsesFP2Ret
protected HasBuiltinMSVaList
protected IsRenderScriptTarget
protected HasAArch64SVETypes
protected HasRISCVVTypes
protected AllowAMDGPUUnsafeFPAtomics
protected ARMCDECoprocMask
protected MaxOpenCLWorkGroupSize
protected MaxBitIntWidth
protected DarwinTargetVariantTriple
protected UseAddrSpaceMapMangling

Inherited from TransferrableTargetInfo:

public PointerWidth
public PointerAlign
public BoolWidth
public BoolAlign
public IntWidth
public IntAlign
public HalfWidth
public HalfAlign
public BFloat16Width
public BFloat16Align
public FloatWidth
public FloatAlign
public DoubleWidth
public DoubleAlign
public LongDoubleWidth
public LongDoubleAlign
public Float128Align
public Ibm128Align
public LargeArrayMinWidth
public LargeArrayAlign
public LongWidth
public LongAlign
public LongLongWidth
public LongLongAlign
public ShortAccumWidth
public ShortAccumAlign
public AccumWidth
public AccumAlign
public LongAccumWidth
public LongAccumAlign
public ShortFractWidth
public ShortFractAlign
public FractWidth
public FractAlign
public LongFractWidth
public LongFractAlign
public PaddingOnUnsignedFixedPoint
public ShortAccumScale
public AccumScale
public LongAccumScale
public DefaultAlignForAttributeAligned
public MinGlobalAlign
public SuitableAlign
public NewAlign
public MaxVectorAlign
public MaxTLSAlign
public HalfFormat
public BFloat16Format
public FloatFormat
public DoubleFormat
public LongDoubleFormat
public Float128Format
public Ibm128Format
protected SizeType
protected IntMaxType
protected PtrDiffType
protected IntPtrType
protected WCharType
protected WIntType
protected Char16Type
protected Char32Type
protected Int64Type
protected Int16Type
protected SigAtomicType
protected ProcessIDType
protected UseSignedCharForObjCBool
protected UseBitFieldTypeAlignment
protected UseZeroLengthBitfieldAlignment
protected UseLeadingZeroLengthBitfield
protected UseExplicitBitFieldAlignment
protected ZeroLengthBitfieldBoundary
protected MaxAlignedAttribute

Method Overview

  • public WebAssemblyTargetInfo(const llvm::Triple & T, const clang::TargetOptions &)
  • private void adjust(clang::DiagnosticsEngine & Diags, clang::LangOptions & Opts)
  • private clang::TargetInfo::CallingConvCheckResult checkCallingConvention(clang::CallingConv CC) const
  • private void fillValidCPUList(SmallVectorImpl<llvm::StringRef> & Values) const
  • public llvm::StringRef getABI() const
  • private clang::TargetInfo::BuiltinVaListKind getBuiltinVaListKind() const
  • private const char * getClobbers() const
  • private ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const
  • private ArrayRef<const char *> getGCCRegNames() const
  • private clang::TransferrableTargetInfo::IntType getIntTypeByWidth(unsigned int BitWidth, bool IsSigned) const
  • private clang::TransferrableTargetInfo::IntType getLeastIntTypeByWidth(unsigned int BitWidth, bool IsSigned) const
  • private ArrayRef<Builtin::Info> getTargetBuiltins() const
  • protected void getTargetDefines(const clang::LangOptions & Opts, clang::MacroBuilder & Builder) const
  • private bool handleTargetFeatures(std::vector<std::string> & Features, clang::DiagnosticsEngine & Diags)
  • private bool hasBitIntType() const
  • private bool hasFeature(llvm::StringRef Feature) const
  • private bool hasInt128Type() const
  • private bool hasProtectedVisibility() const
  • private bool initFeatureMap(llvm::StringMap<bool> & Features, clang::DiagnosticsEngine & Diags, llvm::StringRef CPU, const std::vector<std::string> & FeaturesVec) const
  • private bool isCLZForZeroUndef() const
  • private bool isValidCPUName(llvm::StringRef Name) const
  • public bool setABI(const std::string & Name)
  • private bool setCPU(const std::string & Name)
  • private void setFeatureEnabled(llvm::StringMap<bool> & Features, llvm::StringRef Name, bool Enabled) const
  • private static void setSIMDLevel(llvm::StringMap<bool> & Features, clang::targets::WebAssemblyTargetInfo::SIMDEnum Level, bool Enabled)
  • private bool validateAsmConstraint(const char *& Name, TargetInfo::ConstraintInfo & Info) const

Inherited from TargetInfo:

Methods

WebAssemblyTargetInfo(const llvm::Triple& T,
                      const clang::TargetOptions&)

Declared at: clang/lib/Basic/Targets/WebAssembly.h:47

Parameters

const llvm::Triple& T
const clang::TargetOptions&

void adjust(clang::DiagnosticsEngine& Diags,
            clang::LangOptions& Opts)

Description

Set forced language options. Apply changes to the target information with respect to certain language options which change the target configuration and adjust the language based on the target options where applicable.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:145

Parameters

clang::DiagnosticsEngine& Diags
clang::LangOptions& Opts

clang::TargetInfo::CallingConvCheckResult
checkCallingConvention(
    clang::CallingConv CC) const

Description

Determines whether a given calling convention is valid for the target. A calling convention can either be accepted, produce a warning and be substituted with the default calling convention, or (someday) produce an error (such as using thiscall on a non-instance function).

Declared at: clang/lib/Basic/Targets/WebAssembly.h:129

Parameters

clang::CallingConv CC

void fillValidCPUList(
    SmallVectorImpl<llvm::StringRef>& Values)
    const

Description

Fill a SmallVectorImpl with the valid values to setCPU.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:89

Parameters

SmallVectorImpl<llvm::StringRef>& Values

llvm::StringRef getABI() const

Description

Get the ABI currently in use.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:65

clang::TargetInfo::BuiltinVaListKind
getBuiltinVaListKind() const

Description

Returns the kind of __builtin_va_list type that should be used with this target.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:95

const char* getClobbers() const

Description

Returns a string of target-specific clobbers, in LLVM format.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:110

ArrayRef<TargetInfo::GCCRegAlias>
getGCCRegAliases() const

Declared at: clang/lib/Basic/Targets/WebAssembly.h:101

ArrayRef<const char*> getGCCRegNames() const

Declared at: clang/lib/Basic/Targets/WebAssembly.h:99

clang::TransferrableTargetInfo::IntType
getIntTypeByWidth(unsigned int BitWidth,
                  bool IsSigned) const

Description

Return integer type with specified width.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:116

Parameters

unsigned int BitWidth
bool IsSigned

clang::TransferrableTargetInfo::IntType
getLeastIntTypeByWidth(unsigned int BitWidth,
                       bool IsSigned) const

Description

Return the smallest integer type with at least the specified width.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:122

Parameters

unsigned int BitWidth
bool IsSigned

ArrayRef<Builtin::Info> getTargetBuiltins() const

Description

Return information about target-specific builtins for the current primary target, and info about which builtins are non-portable across the current set of primary and secondary targets.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:93

void getTargetDefines(
    const clang::LangOptions& Opts,
    clang::MacroBuilder& Builder) const

Description

Appends the target-specific # define values for this target set to the specified buffer.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:69

Parameters

const clang::LangOptions& Opts
clang::MacroBuilder& Builder

bool handleTargetFeatures(
    std::vector<std::string>& Features,
    clang::DiagnosticsEngine& Diags)

Description

Perform initialization based on the user configured set of features (e.g., +sse4). The list is guaranteed to have at most one entry per feature. The target may modify the features list, to change which options are passed onwards to the backend. FIXME: This part should be fixed so that we can change handleTargetFeatures to merely a TargetInfo initialization routine.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:85

Parameters

std::vector<std::string>& Features
clang::DiagnosticsEngine& Diags

Returns

False on error.

bool hasBitIntType() const

Description

Determine whether the _BitInt type is supported on this target. This limitation is put into place for ABI reasons. FIXME: _BitInt is a required type in C23, so there's not much utility in asking whether the target supported it or not; I think this should be removed once backends have been alerted to the type and have had the chance to do implementation work if needed.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:141

bool hasFeature(llvm::StringRef Feature) const

Description

Determine whether the given target has the given feature.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:80

Parameters

llvm::StringRef Feature

bool hasInt128Type() const

Description

Determine whether the __int128 type is supported on this target.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:114

bool hasProtectedVisibility() const

Description

Does this target support "protected" visibility? Any target which dynamic libraries will naturally support something like "default" (meaning that the symbol is visible outside this shared object) and "hidden" (meaning that it isn't) visibilities, but "protected" is really an ELF-specific concept with weird semantics designed around the convenience of dynamic linker implementations. Which is not to suggest that there's consistent target-independent semantics for "default" visibility either; the entire thing is pretty badly mangled.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:143

bool initFeatureMap(
    llvm::StringMap<bool>& Features,
    clang::DiagnosticsEngine& Diags,
    llvm::StringRef CPU,
    const std::vector<std::string>& FeaturesVec)
    const

Description

Initialize the map with the default set of target features for the CPU this should include all legal feature strings on the target.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:77

Parameters

llvm::StringMap<bool>& Features
clang::DiagnosticsEngine& Diags
llvm::StringRef CPU
const std::vector<std::string>& FeaturesVec

Returns

False on error (invalid features).

bool isCLZForZeroUndef() const

Description

The __builtin_clz* and __builtin_ctz* built-in functions are specified to have undefined results for zero inputs, but on targets that support these operations in a way that provides well-defined results for zero without loss of performance, it is a good idea to avoid optimizing based on that undef behavior.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:112

bool isValidCPUName(llvm::StringRef Name) const

Description

brief Determine whether this TargetInfo supports the given CPU name.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:88

Parameters

llvm::StringRef Name

bool setABI(const std::string& Name)

Description

Use the specified ABI.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:66

Parameters

const std::string& Name

Returns

False on error (invalid ABI name).

bool setCPU(const std::string& Name)

Description

Target the specified CPU.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:91

Parameters

const std::string& Name

Returns

False on error (invalid CPU name).

void setFeatureEnabled(
    llvm::StringMap<bool>& Features,
    llvm::StringRef Name,
    bool Enabled) const

Description

Enable or disable a specific target feature; the feature name must be valid.

Declared at: clang/lib/Basic/Targets/WebAssembly.h:82

Parameters

llvm::StringMap<bool>& Features
llvm::StringRef Name
bool Enabled

static void setSIMDLevel(
    llvm::StringMap<bool>& Features,
    clang::targets::WebAssemblyTargetInfo::
        SIMDEnum Level,
    bool Enabled)

Declared at: clang/lib/Basic/Targets/WebAssembly.h:73

Parameters

llvm::StringMap<bool>& Features
clang::targets::WebAssemblyTargetInfo::SIMDEnum Level
bool Enabled

bool validateAsmConstraint(
    const char*& Name,
    TargetInfo::ConstraintInfo& Info) const

Declared at: clang/lib/Basic/Targets/WebAssembly.h:105

Parameters

const char*& Name
TargetInfo::ConstraintInfo& Info