13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_LOONGARCH_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_LOONGARCH_H
18#include "llvm/Support/Compiler.h"
19#include "llvm/TargetParser/Triple.h"
68 bool setCPU(StringRef Name)
override {
107 bool validateAsmConstraint(
const char *&Name,
109 std::string convertConstraint(
const char *&Constraint)
const override;
115 bool handleTargetFeatures(std::vector<std::string> &Features,
124 const std::vector<std::string> &FeaturesVec)
const override;
128 bool isValidCPUName(StringRef Name)
const override;
130 bool isValidFeatureName(StringRef Name)
const override;
146 bool setABI(
const std::string &Name)
override {
147 if (Name ==
"ilp32d" || Name ==
"ilp32f" || Name ==
"ilp32s") {
171 bool setABI(
const std::string &Name)
override {
172 if (Name ==
"lp64d" || Name ==
"lp64f" || Name ==
"lp64s") {
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...
TargetInfo(const llvm::Triple &T)
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
@ VoidPtrBuiltinVaList
typedef void* __builtin_va_list;
unsigned HasUnalignedAccess
unsigned char MaxAtomicPromoteWidth
void resetDataLayout(StringRef DL)
Set the data layout to the given string.
unsigned char MaxAtomicInlineWidth
Options for controlling the target.
LoongArch32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
bool setABI(const std::string &Name) override
Use the specified ABI.
void setMaxAtomicWidth() override
Set the maximum inline or promote width lock-free atomic operation for the given target.
bool setABI(const std::string &Name) override
Use the specified ABI.
void setMaxAtomicWidth() override
Set the maximum inline or promote width lock-free atomic operation for the given target.
LoongArch64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
StringRef getConstraintRegister(StringRef Constraint, StringRef Expression) const override
Extracts a register from the passed constraint (if it is a single-register constraint) and the asm la...
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
StringRef getABI() const override
Get the ABI currently in use.
bool isValidCPUName(StringRef Name) const override
Determine whether this TargetInfo supports the given CPU name.
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
bool hasBFloat16Type() const override
Determine whether the _BFloat16 type is supported on this target.
bool setCPU(StringRef Name) override
Target the specified CPU.
int getEHDataRegisterNumber(unsigned RegNo) const override
Return the register number that __builtin_eh_return_regno would return with the specified argument.
LoongArchTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
bool supportsTargetAttributeTune() const override
Determine whether this TargetInfo supports tune in target attribute.
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
Defines the clang::TargetInfo interface.
Top level wrappers for InstallAPI frontend operations.
Contains information gathered from parsing the contents of TargetAttr.
unsigned short SuitableAlign
unsigned char PointerWidth
const llvm::fltSemantics * LongDoubleFormat
std::optional< unsigned > BitIntMaxAlign
unsigned char PointerAlign
unsigned char BFloat16Width
unsigned char LongDoubleAlign
unsigned char LongDoubleWidth
unsigned char BFloat16Align
const llvm::fltSemantics * BFloat16Format