|
clang 24.0.0git
|
C++ view class that accepts both !cir.struct and !cir.union types. More...
#include "clang/CIR/Dialect/IR/CIRTypes.h"
Public Member Functions | |
| RecordType (StructType t) | |
| RecordType (UnionType t) | |
| llvm::ArrayRef< mlir::Type > | getMembers () const |
| mlir::StringAttr | getName () const |
| bool | isIncomplete () const |
| bool | isComplete () const |
| bool | getPacked () const |
| bool | getPadded () const |
| llvm::ArrayRef< RecordMemberKind > | getMemberKinds () const |
| bool | isClass () const |
| bool | isStruct () const |
| bool | isUnion () const |
| bool | isEmptyForABI () const |
| Whether no member holds data. | |
| size_t | getNumElements () const |
| mlir::Type | getElementType (size_t idx) const |
| std::string | getKindAsStr () const |
| std::string | getPrefixedName () const |
| void | complete (llvm::ArrayRef< mlir::Type > members, bool packed, mlir::Type padding, llvm::ArrayRef< RecordMemberKind > memberKinds) |
padding is union-only. | |
| uint64_t | getElementOffset (const mlir::DataLayout &dataLayout, unsigned idx) const |
| bool | isLayoutIdentical (const RecordType &other) |
| bool | isABIConvertedRecord () const |
| mlir::StringAttr | getABIConvertedName () const |
| void | removeABIConversionNamePrefix () |
Static Public Member Functions | |
| static bool | classof (mlir::Type t) |
| static llvm::SmallVector< RecordMemberKind > | getAllDataKinds (llvm::ArrayRef< mlir::Type > members) |
| One Data kind per member. | |
C++ view class that accepts both !cir.struct and !cir.union types.
Follows the MLIR BaseMemRefType pattern: StructType and UnionType are the concrete tablegen types; RecordType is a hand-written view class that covers both. Use it when code must handle either kind generically.
Methods that are common to both types are forwarded through dyn_cast dispatch. Type-specific methods (getPadding, getUnionStorageType) are only available on the concrete type.
Definition at line 150 of file CIRTypes.h.
|
inline |
Definition at line 158 of file CIRTypes.h.
Referenced by isLayoutIdentical().
|
inline |
Definition at line 160 of file CIRTypes.h.
|
inlinestatic |
Definition at line 162 of file CIRTypes.h.
| void RecordType::complete | ( | llvm::ArrayRef< mlir::Type > | members, |
| bool | packed, | ||
| mlir::Type | padding, | ||
| llvm::ArrayRef< RecordMemberKind > | memberKinds ) |
padding is union-only.
A struct carries its padding as a member marked pad.
Definition at line 696 of file CIRTypes.cpp.
Referenced by clang::CIRGen::CIRGenTypes::computeRecordLayout().
| mlir::StringAttr RecordType::getABIConvertedName | ( | ) | const |
Definition at line 730 of file CIRTypes.cpp.
|
static |
One Data kind per member.
Takes the member list rather than a count so the length cannot drift from the record it describes.
Definition at line 151 of file CIRTypes.cpp.
Referenced by abiTypeToCIR(), convertDirectArgInfo(), clang::CIRGen::CIRGenFunction::createGetCpuModel(), clang::CIRGen::CIRGenFunction::emitAMDGPUBuiltinExpr(), clang::CIRGen::CIRGenFunction::emitAsmStmt(), emitEncodeKey(), emitLogbBuiltin(), emitX86Aes(), emitX86Aeswide(), clang::CIRGen::CIRGenFunction::emitX86BuiltinExpr(), clang::CIRGen::CIRGenBuilderTy::getAnonConstRecord(), getMethodLayoutType(), getNeonMultiVecTy(), and clang::CIRGen::CIRGenVTables::getVTableType().
Definition at line 706 of file CIRTypes.cpp.
Referenced by clang::CIRGen::CIRGenFunction::emitAddrOfFieldStorage(), and mapCIRType().
|
inline |
Definition at line 189 of file CIRTypes.h.
References getMembers().
| std::string RecordType::getKindAsStr | ( | ) | const |
Definition at line 688 of file CIRTypes.cpp.
Referenced by getPrefixedName().
| llvm::ArrayRef< RecordMemberKind > RecordType::getMemberKinds | ( | ) | const |
Definition at line 673 of file CIRTypes.cpp.
Referenced by isEmptyForABI(), and mapCIRType().
| llvm::ArrayRef< mlir::Type > RecordType::getMembers | ( | ) | const |
Definition at line 648 of file CIRTypes.cpp.
Referenced by collectStoredInitializers(), clang::CIRGen::CIRGenFunction::emitAddrOfFieldStorage(), getElementType(), getNumElements(), isEmptyForABI(), mapCIRType(), and memberPointeeType().
| mlir::StringAttr RecordType::getName | ( | ) | const |
Definition at line 653 of file CIRTypes.cpp.
Referenced by clang::CIRGen::CIRGenTypes::computeRecordLayout(), getPrefixedName(), recordCanPassInRegs(), recordDeclaredAlign(), recordHasFlexibleArrayMember(), recordIsTransparentUnion(), and recordUnadjustedAlign().
|
inline |
Definition at line 188 of file CIRTypes.h.
References getMembers().
| bool RecordType::getPacked | ( | ) | const |
Definition at line 663 of file CIRTypes.cpp.
| bool RecordType::getPadded | ( | ) | const |
Definition at line 668 of file CIRTypes.cpp.
| std::string RecordType::getPrefixedName | ( | ) | const |
Definition at line 693 of file CIRTypes.cpp.
References getKindAsStr(), and getName().
| bool RecordType::isABIConvertedRecord | ( | ) | const |
Definition at line 725 of file CIRTypes.cpp.
| bool RecordType::isClass | ( | ) | const |
Definition at line 678 of file CIRTypes.cpp.
|
inline |
Definition at line 169 of file CIRTypes.h.
References isIncomplete().
Referenced by clang::CIRGen::CIRGenTypes::convertRecordDeclType().
| bool RecordType::isEmptyForABI | ( | ) | const |
Whether no member holds data.
Vacuously true for a complete record with no members, and false for an incomplete one, whose members are not known yet. A union's tail-padding slot is not a member and does not count.
Definition at line 741 of file CIRTypes.cpp.
References cir::anyMemberHoldsDataForABI(), getMemberKinds(), getMembers(), and isIncomplete().
Referenced by mapCIRType(), and marksMatchABIEmptiness().
| bool RecordType::isIncomplete | ( | ) | const |
Definition at line 658 of file CIRTypes.cpp.
Referenced by clang::CIRGen::CIRGenTypes::computeRecordLayout(), isComplete(), and isEmptyForABI().
| bool RecordType::isLayoutIdentical | ( | const RecordType & | other | ) |
Definition at line 712 of file CIRTypes.cpp.
References RecordType().
| bool RecordType::isStruct | ( | ) | const |
Definition at line 683 of file CIRTypes.cpp.
Referenced by cir::CIRABIRewriteContext::rewriteCallSite().
|
inline |
Definition at line 176 of file CIRTypes.h.
Referenced by mapCIRType().
| void RecordType::removeABIConversionNamePrefix | ( | ) |
Definition at line 735 of file CIRTypes.cpp.