13#ifndef CIR_DIALECT_IR_CIRTYPESDETAILS_H
14#define CIR_DIALECT_IR_CIRTYPESDETAILS_H
16#include "mlir/IR/BuiltinAttributes.h"
17#include "mlir/Support/LogicalResult.h"
19#include "llvm/ADT/Hashing.h"
36 RecordType::RecordKind
kind;
40 RecordType::RecordKind
kind)
50 RecordType::RecordKind
kind;
54 RecordType::RecordKind
kind)
57 assert((
name || !
incomplete) &&
"Incomplete records must have a name");
74 return llvm::hash_combine(key.
name, key.
kind);
92 llvm::LogicalResult
mutate(mlir::TypeStorageAllocator &allocator,
97 return llvm::failure();
101 return mlir::success((this->members ==
members) &&
102 (this->packed ==
packed) &&
103 (this->padded ==
padded));
106 this->members = allocator.copyInto(
members);
111 return llvm::success();
llvm::ArrayRef< mlir::Type > members
RecordType::RecordKind kind
KeyTy(llvm::ArrayRef< mlir::Type > members, mlir::StringAttr name, bool incomplete, bool packed, bool padded, RecordType::RecordKind kind)
Type storage for CIR record types.
bool operator==(const KeyTy &key) const
static llvm::hash_code hashKey(const KeyTy &key)
static RecordTypeStorage * construct(mlir::TypeStorageAllocator &allocator, const KeyTy &key)
llvm::ArrayRef< mlir::Type > members
llvm::LogicalResult mutate(mlir::TypeStorageAllocator &allocator, llvm::ArrayRef< mlir::Type > members, bool packed, bool padded)
Mutates the members and attributes an identified record.
RecordTypeStorage(llvm::ArrayRef< mlir::Type > members, mlir::StringAttr name, bool incomplete, bool packed, bool padded, RecordType::RecordKind kind)
RecordType::RecordKind kind