5#include "mlir/Dialect/Ptr/IR/MemorySpaceInterfaces.h"
19 if (
const CXXRecordDecl *cxxrd = dyn_cast<CXXRecordDecl>(rd)) {
20 if (cxxrd->isDynamicClass())
23 for (
const auto &i : cxxrd->bases())
28 for (
const auto *i : rd->fields())
48class AMDGPUABIInfo :
public ABIInfo {
55 AMDGPUTargetCIRGenInfo(CIRGenTypes &cgt)
56 : TargetCIRGenInfo(std::make_unique<AMDGPUABIInfo>(cgt)) {}
58 void setTargetAttributes(
const clang::Decl *
decl, mlir::Operation *global,
59 CIRGenModule &cgm)
const override {
60 if (
auto func = mlir::dyn_cast<cir::FuncOp>(global)) {
62 func.setGlobalVisibility(cir::VisibilityKind::Protected);
63 func.setDSOLocal(
true);
66 }
else if (
auto gv = mlir::dyn_cast<cir::GlobalOp>(global)) {
68 gv.setGlobalVisibility(cir::VisibilityKind::Protected);
79class X8664ABIInfo :
public ABIInfo {
81 X8664ABIInfo(CIRGenTypes &cgt) : ABIInfo(cgt) {}
86 X8664TargetCIRGenInfo(CIRGenTypes &cgt)
87 : TargetCIRGenInfo(std::make_unique<X8664ABIInfo>(cgt)) {}
94class NVPTXABIInfo :
public ABIInfo {
96 NVPTXABIInfo(CIRGenTypes &cgt) : ABIInfo(cgt) {}
101 NVPTXTargetCIRGenInfo(CIRGenTypes &cgt)
102 : TargetCIRGenInfo(std::make_unique<NVPTXABIInfo>(cgt)) {}
106std::unique_ptr<TargetCIRGenInfo>
108 return std::make_unique<AMDGPUTargetCIRGenInfo>(cgt);
111std::unique_ptr<TargetCIRGenInfo>
113 return std::make_unique<NVPTXTargetCIRGenInfo>(cgt);
116std::unique_ptr<TargetCIRGenInfo>
118 return std::make_unique<X8664TargetCIRGenInfo>(cgt);
137 "Address space agnostic languages only");
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
This class organizes the cross-function state that is used while generating CIR code.
const clang::LangOptions & getLangOpts() const
This class organizes the cross-module state that is used while lowering AST types to CIR types.
TargetCIRGenInfo(std::unique_ptr< ABIInfo > info)
virtual clang::LangAS getGlobalVarAddressSpace(CIRGenModule &cgm, const clang::VarDecl *d) const
Get target favored AST address space of a global variable for languages other than OpenCL and CUDA.
virtual bool isNoProtoCallVariadic(const FunctionNoProtoType *fnType) const
Determine whether a call to an unprototyped functions under the given calling convention should use t...
Represents a C++ struct/union/class.
Represents a member of a struct/union/class.
bool isUnnamedBitField() const
Determines whether this is an unnamed bitfield.
bool isZeroLengthBitField() const
Is this a zero-length bit-field?
Represents a K&R-style 'int foo()' function, which has no information available about its arguments.
A (possibly-)qualified type.
LangAS getAddressSpace() const
Return the address space of this type.
RecordDecl * getAsRecordDecl() const
Retrieves the RecordDecl this type refers to.
Represents a variable declaration or definition.
void setAMDGPUTargetFunctionAttributes(const clang::Decl *decl, cir::FuncOp func, CIRGenModule &cgm)
Set AMDGPU-specific function attributes for HIP kernels.
std::unique_ptr< TargetCIRGenInfo > createAMDGPUTargetCIRGenInfo(CIRGenTypes &cgt)
std::unique_ptr< TargetCIRGenInfo > createNVPTXTargetCIRGenInfo(CIRGenTypes &cgt)
std::unique_ptr< TargetCIRGenInfo > createX8664TargetCIRGenInfo(CIRGenTypes &cgt)
bool isEmptyFieldForLayout(const ASTContext &context, const FieldDecl *fd)
isEmptyFieldForLayout - Return true if the field is "empty", that is, either a zero-width bit-field o...
bool isEmptyRecordForLayout(const ASTContext &context, QualType t)
isEmptyRecordForLayout - Return true if a structure contains only empty base classes (per isEmptyReco...
bool requiresAMDGPUProtectedVisibility(const clang::Decl *d, cir::VisibilityKind visibility)
Check if AMDGPU protected visibility is required.
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
The JSON file list parser is used to communicate input to InstallAPI.
LangAS
Defines the address space values used by the address space qualifier of QualType.