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"
26#include "llvm/ADT/SmallVector.h"
54 mlir::MLIRContext *ctx);
68mlir::ptr::MemorySpaceAttrInterface
72mlir::ptr::MemorySpaceAttrInterface
76 mlir::ptr::MemorySpaceAttrInterface memorySpace);
86#include "clang/CIR/Dialect/IR/CIRTypeConstraints.h.inc"
90#define GET_TYPEDEF_CLASSES
91#include "clang/CIR/Dialect/IR/CIROpsTypes.h.inc"
106 using mlir::Type::Type;
117 return mlir::isa<StructType>(t) || mlir::isa<UnionType>(t);
121 mlir::StringAttr
getName()
const;
130 bool isUnion()
const {
return mlir::isa<UnionType>(*
this); }
Provides definitions for the various language-specific address spaces.
C++ view class that accepts both !cir.struct and !cir.union types.
bool isLayoutIdentical(const RecordType &other)
mlir::Type getElementType(size_t idx) const
bool isABIConvertedRecord() const
bool isIncomplete() const
bool isEmptyForABI() const
Whether no member holds data.
std::string getPrefixedName() const
llvm::ArrayRef< mlir::Type > getMembers() const
void removeABIConversionNamePrefix()
static bool classof(mlir::Type t)
static llvm::SmallVector< RecordMemberKind > getAllDataKinds(llvm::ArrayRef< mlir::Type > members)
One Data kind per member.
mlir::StringAttr getName() const
void complete(llvm::ArrayRef< mlir::Type > members, bool packed, mlir::Type padding, llvm::ArrayRef< RecordMemberKind > memberKinds)
padding is union-only.
mlir::StringAttr getABIConvertedName() const
std::string getKindAsStr() const
llvm::ArrayRef< RecordMemberKind > getMemberKinds() 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)
cir::FPTypeInterface getFloatingPointType(const llvm::fltSemantics &sem, mlir::MLIRContext *ctx)
Returns the CIR floating-point type for the given semantics, or a null type if CIR has no type for it...
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.
Diagnostic wrappers for TextAPI types for error reporting.
Type storage for CIR struct/class types.
Type storage for CIR union types.