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"
55 assert((
name || !
incomplete) &&
"Incomplete records must have a name");
85 llvm::LogicalResult
mutate(mlir::TypeStorageAllocator &allocator,
89 return llvm::failure();
92 return mlir::success((this->members ==
members) &&
93 (this->packed ==
packed) &&
96 this->members = allocator.copyInto(
members);
100 return llvm::success();
133 assert((
name || !
incomplete) &&
"Incomplete records must have a name");
150 return llvm::hash_combine(key.
name);
163 llvm::LogicalResult
mutate(mlir::TypeStorageAllocator &allocator,
167 return llvm::failure();
170 return mlir::success((this->members ==
members) &&
171 (this->packed ==
packed) &&
174 this->members = allocator.copyInto(
members);
178 return llvm::success();
KeyTy(llvm::ArrayRef< mlir::Type > members, mlir::StringAttr name, bool incomplete, bool packed, bool padded, bool is_class)
llvm::ArrayRef< mlir::Type > members
static llvm::hash_code hashKey(const KeyTy &key)
StructTypeStorage(llvm::ArrayRef< mlir::Type > members, mlir::StringAttr name, bool incomplete, bool packed, bool padded, bool is_class)
llvm::ArrayRef< mlir::Type > members
static StructTypeStorage * construct(mlir::TypeStorageAllocator &allocator, const KeyTy &key)
bool operator==(const KeyTy &key) const
llvm::LogicalResult mutate(mlir::TypeStorageAllocator &allocator, llvm::ArrayRef< mlir::Type > members, bool packed, bool padded)
Mutates the members and attributes of an identified struct/class.
KeyTy(llvm::ArrayRef< mlir::Type > members, mlir::StringAttr name, bool incomplete, bool packed, mlir::Type padding)
llvm::ArrayRef< mlir::Type > members
llvm::ArrayRef< mlir::Type > members
bool operator==(const KeyTy &key) const
static llvm::hash_code hashKey(const KeyTy &key)
static UnionTypeStorage * construct(mlir::TypeStorageAllocator &allocator, const KeyTy &key)
UnionTypeStorage(llvm::ArrayRef< mlir::Type > members, mlir::StringAttr name, bool incomplete, bool packed, mlir::Type padding)
llvm::LogicalResult mutate(mlir::TypeStorageAllocator &allocator, llvm::ArrayRef< mlir::Type > members, bool packed, mlir::Type padding)
Mutates the members and attributes of an identified union.