13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_BPF_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_BPF_H
18#include "llvm/Support/Compiler.h"
19#include "llvm/TargetParser/Triple.h"
25 bool HasAlu32 =
false;
30 LongWidth = LongAlign = PointerWidth = PointerAlign = 64;
31 SizeType = UnsignedLong;
32 PtrDiffType = SignedLong;
33 IntPtrType = SignedLong;
34 IntMaxType = SignedLong;
35 Int64Type = SignedLong;
37 if (Triple.getArch() == llvm::Triple::bpfeb) {
38 resetDataLayout(
"E-m:e-p:64:64-i64:64-i128:128-n32:64-S128");
40 resetDataLayout(
"e-m:e-p:64:64-i64:64-i128:128-n32:64-S128");
42 MaxAtomicPromoteWidth = 64;
43 MaxAtomicInlineWidth = 64;
51 return Feature ==
"bpf" || Feature ==
"alu32" || Feature ==
"dwarfris";
55 bool Enabled)
const override {
56 Features[Name] = Enabled;
58 bool handleTargetFeatures(std::vector<std::string> &Features,
66 return TargetInfo::VoidPtrBuiltinVaList;
104 bool isValidCPUName(StringRef Name)
const override;
108 bool setCPU(
const std::string &Name)
override {
109 if (Name ==
"v3" || Name ==
"v4") {
113 StringRef CPUName(Name);
114 return isValidCPUName(CPUName);
118 return std::make_pair(32, 32);
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.
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Options for controlling the target.
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
BPFTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
void setFeatureEnabled(llvm::StringMap< bool > &Features, StringRef Name, bool Enabled) const override
Enable or disable a specific target feature; the feature name must be valid.
bool setCPU(const std::string &Name) override
Target the specified CPU.
bool allowDebugInfoForExternalRef() const override
Whether target allows debuginfo types for decl only variables/functions.
bool hasFeature(StringRef Feature) const override
Determine whether the given target has the given feature.
std::pair< unsigned, unsigned > hardwareInterferenceSizes() const override
The first value in the pair is the minimum offset between two objects to avoid false sharing (destruc...
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &Info) const override
ArrayRef< const char * > getGCCRegNames() const override
bool isValidGCCRegisterName(StringRef Name) const override
Returns whether the passed in string is a valid register name according to GCC.
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Defines the clang::TargetInfo interface.
The JSON file list parser is used to communicate input to InstallAPI.
CallingConv
CallingConv - Specifies the calling convention that a function uses.