clang 23.0.0git
cir::CIRCXXABI Class Referenceabstract

#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRCXXABI.h"

Public Member Functions

virtual ~CIRCXXABI ()
virtual mlir::Type lowerDataMemberType (cir::DataMemberType type, const mlir::TypeConverter &typeConverter) const =0
 Lower the given data member pointer type to its ABI type.
virtual mlir::Type lowerMethodType (cir::MethodType type, const mlir::TypeConverter &typeConverter) const =0
 Lower the given member function pointer type to its ABI type.
virtual mlir::TypedAttr lowerDataMemberConstant (cir::DataMemberAttr attr, const mlir::DataLayout &layout, const mlir::TypeConverter &typeConverter) const =0
 Lower the given data member pointer constant to a constant of the ABI type.
virtual mlir::TypedAttr lowerMethodConstant (cir::MethodAttr attr, const mlir::DataLayout &layout, const mlir::TypeConverter &typeConverter) const =0
 Lower the given member function pointer constant to a constant of the ABI type.
virtual mlir::Operation * lowerGetRuntimeMember (cir::GetRuntimeMemberOp op, mlir::Type loweredResultTy, mlir::Value loweredAddr, mlir::Value loweredMember, mlir::OpBuilder &builder) const =0
 Lower the given cir.get_runtime_member op to a sequence of more "primitive" CIR operations that act on the ABI types.
virtual void lowerGetMethod (cir::GetMethodOp op, mlir::Value &callee, mlir::Value &thisArg, mlir::Value loweredMethod, mlir::Value loweredObjectPtr, mlir::ConversionPatternRewriter &rewriter) const =0
 Lower the given cir.get_method op to a sequence of more "primitive" CIR operations that act on the ABI types.
virtual mlir::Value lowerBaseDataMember (cir::BaseDataMemberOp op, mlir::Value loweredSrc, mlir::OpBuilder &builder) const =0
 Lower the given cir.base_data_member op to a sequence of more "primitive" CIR operations that act on the ABI types.
virtual mlir::Value lowerDerivedDataMember (cir::DerivedDataMemberOp op, mlir::Value loweredSrc, mlir::OpBuilder &builder) const =0
 Lower the given cir.derived_data_member op to a sequence of more "primitive" CIR operations that act on the ABI types.
virtual mlir::Value lowerBaseMethod (cir::BaseMethodOp op, mlir::Value loweredSrc, mlir::OpBuilder &builder) const =0
virtual mlir::Value lowerDerivedMethod (cir::DerivedMethodOp op, mlir::Value loweredSrc, mlir::OpBuilder &builder) const =0
virtual mlir::Value lowerDataMemberCmp (cir::CmpOp op, mlir::Value loweredLhs, mlir::Value loweredRhs, mlir::OpBuilder &builder) const =0
virtual mlir::Value lowerMethodCmp (cir::CmpOp op, mlir::Value loweredLhs, mlir::Value loweredRhs, mlir::OpBuilder &builder) const =0
virtual mlir::Value lowerDataMemberBitcast (cir::CastOp op, mlir::Type loweredDstTy, mlir::Value loweredSrc, mlir::OpBuilder &builder) const =0
virtual mlir::Value lowerDataMemberToBoolCast (cir::CastOp op, mlir::Value loweredSrc, mlir::OpBuilder &builder) const =0
virtual mlir::Value lowerMethodBitcast (cir::CastOp op, mlir::Type loweredDstTy, mlir::Value loweredSrc, mlir::OpBuilder &builder) const =0
virtual mlir::Value lowerMethodToBoolCast (cir::CastOp op, mlir::Value loweredSrc, mlir::OpBuilder &builder) const =0
virtual mlir::Value lowerDynamicCast (cir::DynamicCastOp op, mlir::OpBuilder &builder) const =0
virtual mlir::Value lowerVTableGetTypeInfo (cir::VTableGetTypeInfoOp op, mlir::OpBuilder &builder) const =0
void readArrayCookie (mlir::Location loc, mlir::Value elementPtr, const mlir::DataLayout &dataLayout, CIRBaseBuilderTy &builder, mlir::Value &numElements, mlir::Value &allocPtr, clang::CharUnits &cookieSize) const
 Read the array cookie for a dynamically-allocated array whose first element is at elementPtr.

Protected Member Functions

 CIRCXXABI (LowerModule &lm)
unsigned getPtrSizeInBits () const
virtual clang::CharUnits getArrayCookieSizeImpl (mlir::Type elementType, const mlir::DataLayout &dataLayout) const =0
 Returns the cookie size in bytes for a dynamically-allocated array of elements with the given type.
virtual mlir::Value readArrayCookieImpl (mlir::Location loc, mlir::Value allocPtr, clang::CharUnits cookieSize, clang::CharUnits cookieAlignment, const mlir::DataLayout &dataLayout, CIRBaseBuilderTy &builder) const =0
 Reads the element count from an array cookie.

Protected Attributes

LowerModulelm

Friends

class LowerModule

Detailed Description

Definition at line 28 of file CIRCXXABI.h.

Constructor & Destructor Documentation

◆ CIRCXXABI()

cir::CIRCXXABI::CIRCXXABI ( LowerModule & lm)
inlineprotected

Definition at line 34 of file CIRCXXABI.h.

References lm, and LowerModule.

◆ ~CIRCXXABI()

cir::CIRCXXABI::~CIRCXXABI ( )
virtual

Definition at line 19 of file CIRCXXABI.cpp.

Member Function Documentation

◆ getArrayCookieSizeImpl()

virtual clang::CharUnits cir::CIRCXXABI::getArrayCookieSizeImpl ( mlir::Type elementType,
const mlir::DataLayout & dataLayout ) const
protectedpure virtual

Returns the cookie size in bytes for a dynamically-allocated array of elements with the given type.

Only called when a cookie is required.

Referenced by readArrayCookie().

◆ getPtrSizeInBits()

unsigned cir::CIRCXXABI::getPtrSizeInBits ( ) const
protected

Definition at line 21 of file CIRCXXABI.cpp.

References clang::Default, and lm.

Referenced by readArrayCookie().

◆ lowerBaseDataMember()

virtual mlir::Value cir::CIRCXXABI::lowerBaseDataMember ( cir::BaseDataMemberOp op,
mlir::Value loweredSrc,
mlir::OpBuilder & builder ) const
pure virtual

Lower the given cir.base_data_member op to a sequence of more "primitive" CIR operations that act on the ABI types.

◆ lowerBaseMethod()

virtual mlir::Value cir::CIRCXXABI::lowerBaseMethod ( cir::BaseMethodOp op,
mlir::Value loweredSrc,
mlir::OpBuilder & builder ) const
pure virtual

◆ lowerDataMemberBitcast()

virtual mlir::Value cir::CIRCXXABI::lowerDataMemberBitcast ( cir::CastOp op,
mlir::Type loweredDstTy,
mlir::Value loweredSrc,
mlir::OpBuilder & builder ) const
pure virtual

◆ lowerDataMemberCmp()

virtual mlir::Value cir::CIRCXXABI::lowerDataMemberCmp ( cir::CmpOp op,
mlir::Value loweredLhs,
mlir::Value loweredRhs,
mlir::OpBuilder & builder ) const
pure virtual

◆ lowerDataMemberConstant()

virtual mlir::TypedAttr cir::CIRCXXABI::lowerDataMemberConstant ( cir::DataMemberAttr attr,
const mlir::DataLayout & layout,
const mlir::TypeConverter & typeConverter ) const
pure virtual

Lower the given data member pointer constant to a constant of the ABI type.

The returned constant is represented as an attribute as well.

Referenced by lowerInitialValue().

◆ lowerDataMemberToBoolCast()

virtual mlir::Value cir::CIRCXXABI::lowerDataMemberToBoolCast ( cir::CastOp op,
mlir::Value loweredSrc,
mlir::OpBuilder & builder ) const
pure virtual

◆ lowerDataMemberType()

virtual mlir::Type cir::CIRCXXABI::lowerDataMemberType ( cir::DataMemberType type,
const mlir::TypeConverter & typeConverter ) const
pure virtual

Lower the given data member pointer type to its ABI type.

The returned type is also a CIR type.

Referenced by CIRABITypeConverter::CIRABITypeConverter().

◆ lowerDerivedDataMember()

virtual mlir::Value cir::CIRCXXABI::lowerDerivedDataMember ( cir::DerivedDataMemberOp op,
mlir::Value loweredSrc,
mlir::OpBuilder & builder ) const
pure virtual

Lower the given cir.derived_data_member op to a sequence of more "primitive" CIR operations that act on the ABI types.

◆ lowerDerivedMethod()

virtual mlir::Value cir::CIRCXXABI::lowerDerivedMethod ( cir::DerivedMethodOp op,
mlir::Value loweredSrc,
mlir::OpBuilder & builder ) const
pure virtual

◆ lowerDynamicCast()

virtual mlir::Value cir::CIRCXXABI::lowerDynamicCast ( cir::DynamicCastOp op,
mlir::OpBuilder & builder ) const
pure virtual

◆ lowerGetMethod()

virtual void cir::CIRCXXABI::lowerGetMethod ( cir::GetMethodOp op,
mlir::Value & callee,
mlir::Value & thisArg,
mlir::Value loweredMethod,
mlir::Value loweredObjectPtr,
mlir::ConversionPatternRewriter & rewriter ) const
pure virtual

Lower the given cir.get_method op to a sequence of more "primitive" CIR operations that act on the ABI types.

The lowered result values will be stored in the given loweredResults array.

◆ lowerGetRuntimeMember()

virtual mlir::Operation * cir::CIRCXXABI::lowerGetRuntimeMember ( cir::GetRuntimeMemberOp op,
mlir::Type loweredResultTy,
mlir::Value loweredAddr,
mlir::Value loweredMember,
mlir::OpBuilder & builder ) const
pure virtual

Lower the given cir.get_runtime_member op to a sequence of more "primitive" CIR operations that act on the ABI types.

◆ lowerMethodBitcast()

virtual mlir::Value cir::CIRCXXABI::lowerMethodBitcast ( cir::CastOp op,
mlir::Type loweredDstTy,
mlir::Value loweredSrc,
mlir::OpBuilder & builder ) const
pure virtual

◆ lowerMethodCmp()

virtual mlir::Value cir::CIRCXXABI::lowerMethodCmp ( cir::CmpOp op,
mlir::Value loweredLhs,
mlir::Value loweredRhs,
mlir::OpBuilder & builder ) const
pure virtual

◆ lowerMethodConstant()

virtual mlir::TypedAttr cir::CIRCXXABI::lowerMethodConstant ( cir::MethodAttr attr,
const mlir::DataLayout & layout,
const mlir::TypeConverter & typeConverter ) const
pure virtual

Lower the given member function pointer constant to a constant of the ABI type.

The returned constant is represented as an attribute as well.

Referenced by lowerInitialValue().

◆ lowerMethodToBoolCast()

virtual mlir::Value cir::CIRCXXABI::lowerMethodToBoolCast ( cir::CastOp op,
mlir::Value loweredSrc,
mlir::OpBuilder & builder ) const
pure virtual

◆ lowerMethodType()

virtual mlir::Type cir::CIRCXXABI::lowerMethodType ( cir::MethodType type,
const mlir::TypeConverter & typeConverter ) const
pure virtual

Lower the given member function pointer type to its ABI type.

The returned type is also a CIR type.

Referenced by CIRABITypeConverter::CIRABITypeConverter().

◆ lowerVTableGetTypeInfo()

virtual mlir::Value cir::CIRCXXABI::lowerVTableGetTypeInfo ( cir::VTableGetTypeInfoOp op,
mlir::OpBuilder & builder ) const
pure virtual

◆ readArrayCookie()

void cir::CIRCXXABI::readArrayCookie ( mlir::Location loc,
mlir::Value elementPtr,
const mlir::DataLayout & dataLayout,
CIRBaseBuilderTy & builder,
mlir::Value & numElements,
mlir::Value & allocPtr,
clang::CharUnits & cookieSize ) const

Read the array cookie for a dynamically-allocated array whose first element is at elementPtr.

Returns the number of elements, the original allocation pointer (before the cookie) as a void*, and the cookie size in bytes. Delegates to getArrayCookieSizeImpl and readArrayCookieImpl.

Definition at line 25 of file CIRCXXABI.cpp.

References clang::CharUnits::fromQuantity(), getArrayCookieSizeImpl(), cir::CIRBaseBuilderTy::getPointerTo(), getPtrSizeInBits(), clang::CharUnits::getQuantity(), cir::CIRBaseBuilderTy::getSIntNTy(), cir::CIRBaseBuilderTy::getUIntNTy(), cir::CIRBaseBuilderTy::getVoidPtrTy(), and readArrayCookieImpl().

◆ readArrayCookieImpl()

virtual mlir::Value cir::CIRCXXABI::readArrayCookieImpl ( mlir::Location loc,
mlir::Value allocPtr,
clang::CharUnits cookieSize,
clang::CharUnits cookieAlignment,
const mlir::DataLayout & dataLayout,
CIRBaseBuilderTy & builder ) const
protectedpure virtual

Reads the element count from an array cookie.

allocPtr is a byte pointer to the start of the allocation (the beginning of the cookie). cookieSize is the value returned by getArrayCookieSizeImpl. cookieAlignment is the alignment at the cookie start, derived from the element type's ABI alignment.

Referenced by readArrayCookie().

◆ LowerModule

friend class LowerModule
friend

Definition at line 29 of file CIRCXXABI.h.

References LowerModule.

Referenced by CIRCXXABI(), and LowerModule.

Member Data Documentation

◆ lm

LowerModule& cir::CIRCXXABI::lm
protected

Definition at line 32 of file CIRCXXABI.h.

Referenced by CIRCXXABI(), and getPtrSizeInBits().


The documentation for this class was generated from the following files: