14#ifndef CLANG_LIB_CIR_DIALECT_TRANSFORMS_TARGETLOWERING_CIRCXXABI_H
15#define CLANG_LIB_CIR_DIALECT_TRANSFORMS_TARGETLOWERING_CIRCXXABI_H
17#include "mlir/Transforms/DialectConversion.h"
45 const mlir::TypeConverter &typeConverter)
const = 0;
51 const mlir::TypeConverter &typeConverter)
const = 0;
55 virtual mlir::TypedAttr
57 const mlir::DataLayout &layout,
58 const mlir::TypeConverter &typeConverter)
const = 0;
62 virtual mlir::TypedAttr
64 const mlir::TypeConverter &typeConverter)
const = 0;
68 virtual mlir::Operation *
70 mlir::Value loweredAddr, mlir::Value loweredMember,
71 mlir::OpBuilder &builder)
const = 0;
77 lowerGetMethod(cir::GetMethodOp op, mlir::Value &callee, mlir::Value &thisArg,
78 mlir::Value loweredMethod, mlir::Value loweredObjectPtr,
79 mlir::ConversionPatternRewriter &rewriter)
const = 0;
84 mlir::Value loweredSrc,
85 mlir::OpBuilder &builder)
const = 0;
91 mlir::OpBuilder &builder)
const = 0;
94 mlir::Value loweredSrc,
95 mlir::OpBuilder &builder)
const = 0;
98 mlir::Value loweredSrc,
99 mlir::OpBuilder &builder)
const = 0;
102 mlir::Value loweredRhs,
103 mlir::OpBuilder &builder)
const = 0;
106 mlir::Value loweredRhs,
107 mlir::OpBuilder &builder)
const = 0;
111 mlir::Value loweredSrc,
112 mlir::OpBuilder &builder)
const = 0;
116 mlir::OpBuilder &builder)
const = 0;
119 mlir::Type loweredDstTy,
120 mlir::Value loweredSrc,
121 mlir::OpBuilder &builder)
const = 0;
124 mlir::Value loweredSrc,
125 mlir::OpBuilder &builder)
const = 0;
128 mlir::OpBuilder &builder)
const = 0;
132 mlir::OpBuilder &builder)
const = 0;
140 const mlir::DataLayout &dataLayout,
142 mlir::Value &allocPtr,
150 const mlir::DataLayout &dataLayout)
const = 0;
158 mlir::Value allocPtr,
161 const mlir::DataLayout &dataLayout,
virtual mlir::Value lowerDynamicCast(cir::DynamicCastOp op, mlir::OpBuilder &builder) const =0
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::Type lowerMethodType(cir::MethodType type, const mlir::TypeConverter &typeConverter) const =0
Lower the given member function pointer type to its ABI type.
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.
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 AB...
virtual mlir::Value lowerDataMemberBitcast(cir::CastOp op, mlir::Type loweredDstTy, mlir::Value loweredSrc, mlir::OpBuilder &builder) const =0
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 o...
virtual mlir::Value lowerMethodToBoolCast(cir::CastOp 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::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::Value lowerDataMemberToBoolCast(cir::CastOp op, mlir::Value loweredSrc, mlir::OpBuilder &builder) const =0
CIRCXXABI(LowerModule &lm)
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.
unsigned getPtrSizeInBits() const
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 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 ...
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::Value lowerMethodCmp(cir::CmpOp op, mlir::Value loweredLhs, mlir::Value loweredRhs, 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 lowerVTableGetTypeInfo(cir::VTableGetTypeInfoOp op, mlir::OpBuilder &builder) const =0
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::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 ...
CharUnits - This is an opaque type for sizes expressed in character units.
std::unique_ptr< CIRCXXABI > createItaniumCXXABI(LowerModule &lm)
Creates an Itanium-family ABI.