13#ifndef CLANG_CIR_DIALECT_IR_CIRTYPES_H
14#define CLANG_CIR_DIALECT_IR_CIRTYPES_H
16#include "mlir/Dialect/Ptr/IR/MemorySpaceInterfaces.h"
17#include "mlir/IR/Attributes.h"
18#include "mlir/IR/BuiltinAttributes.h"
19#include "mlir/IR/MLIRContext.h"
20#include "mlir/IR/Types.h"
21#include "mlir/Interfaces/DataLayoutInterfaces.h"
57mlir::ptr::MemorySpaceAttrInterface
61mlir::ptr::MemorySpaceAttrInterface
65 mlir::ptr::MemorySpaceAttrInterface memorySpace);
75#include "clang/CIR/Dialect/IR/CIRTypeConstraints.h.inc"
79#define GET_TYPEDEF_CLASSES
80#include "clang/CIR/Dialect/IR/CIROpsTypes.h.inc"
95 using mlir::Type::Type;
106 return mlir::isa<StructType>(t) || mlir::isa<UnionType>(t);
110 mlir::StringAttr
getName()
const;
118 bool isUnion()
const {
return mlir::isa<UnionType>(*
this); }
126 mlir::Type padding = {});
Provides definitions for the various language-specific address spaces.
bool isLayoutIdentical(const RecordType &other)
mlir::Type getElementType(size_t idx) const
bool isABIConvertedRecord() const
bool isIncomplete() const
std::string getPrefixedName() const
llvm::ArrayRef< mlir::Type > getMembers() const
void removeABIConversionNamePrefix()
static bool classof(mlir::Type t)
void complete(llvm::ArrayRef< mlir::Type > members, bool packed, bool padded, mlir::Type padding={})
mlir::StringAttr getName() const
mlir::StringAttr getABIConvertedName() const
std::string getKindAsStr() const
size_t getNumElements() const
uint64_t getElementOffset(const mlir::DataLayout &dataLayout, unsigned idx) const
bool isMatchingAddressSpace(mlir::ptr::MemorySpaceAttrInterface cirAS, clang::LangAS as)
cir::LangAddressSpace toCIRLangAddressSpace(clang::LangAS langAS)
bool isValidFundamentalIntWidth(unsigned width)
mlir::ptr::MemorySpaceAttrInterface toCIRAddressSpaceAttr(mlir::MLIRContext &ctx, clang::LangAS langAS)
Convert an AST LangAS to the appropriate CIR address space attribute interface.
mlir::ptr::MemorySpaceAttrInterface normalizeDefaultAddressSpace(mlir::ptr::MemorySpaceAttrInterface addrSpace)
Normalize LangAddressSpace::Default to null (empty attribute).
bool isSized(mlir::Type ty)
Returns true if the type is a CIR sized type.
bool isSupportedCIRMemorySpaceAttr(mlir::ptr::MemorySpaceAttrInterface memorySpace)
LangAS
Defines the address space values used by the address space qualifier of QualType.
Type storage for CIR struct/class types.
Type storage for CIR union types.