Skip to content

Commit 5e25553

Browse files
committed
Fix issues in reviews
1 parent ba4b5aa commit 5e25553

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

clang/lib/CIR/CodeGen/CIRGenCall.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,9 @@ RValue CIRGenFunction::GetUndefRValue(QualType Ty) {
719719
mlir::Value CIRGenFunction::buildRuntimeCall(mlir::Location loc,
720720
mlir::cir::FuncOp callee,
721721
ArrayRef<mlir::Value> args) {
722+
// TODO(cir): set the calling convention to this runtime call.
723+
assert(!UnimplementedFeature::setCallingConv());
724+
722725
auto call = builder.create<mlir::cir::CallOp>(loc, callee, args);
723726
assert(call->getNumResults() <= 1 &&
724727
"runtime functions have at most 1 result");

clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,8 +944,7 @@ mlir::Value CIRGenFunction::buildDynamicCast(Address ThisAddr,
944944
QualType srcRecordTy;
945945
QualType destRecordTy;
946946
if (isDynCastToVoid) {
947-
srcRecordTy = srcTy->getPointeeType();
948-
// No DestRecordTy.
947+
llvm_unreachable("NYI");
949948
} else if (const PointerType *DestPTy = destTy->getAs<PointerType>()) {
950949
srcRecordTy = srcTy->castAs<PointerType>()->getPointeeType();
951950
destRecordTy = DestPTy->getPointeeType();

clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,13 +2188,20 @@ void CIRGenItaniumCXXABI::buildThrow(CIRGenFunction &CGF,
21882188

21892189
static mlir::cir::FuncOp getBadCastFn(CIRGenFunction &CGF) {
21902190
// Prototype: void __cxa_bad_cast();
2191+
2192+
// TODO(cir): set the calling convention of the runtime function.
2193+
assert(!UnimplementedFeature::setCallingConv());
2194+
21912195
mlir::cir::FuncType FTy =
21922196
CGF.getBuilder().getFuncType({}, CGF.getBuilder().getVoidTy());
21932197
return CGF.CGM.getOrCreateRuntimeFunction(FTy, "__cxa_bad_cast");
21942198
}
21952199

21962200
void CIRGenItaniumCXXABI::buildBadCastCall(CIRGenFunction &CGF,
21972201
mlir::Location loc) {
2202+
// TODO(cir): set the calling convention to the runtime function.
2203+
assert(!UnimplementedFeature::setCallingConv());
2204+
21982205
CGF.buildRuntimeCall(loc, getBadCastFn(CGF));
21992206
// TODO(cir): mark the current insertion point as unreachable.
22002207
}
@@ -2262,6 +2269,9 @@ static mlir::cir::FuncOp getItaniumDynamicCastFn(CIRGenFunction &CGF) {
22622269

22632270
// TODO(cir): mark the function as nowind readonly.
22642271

2272+
// TODO(cir): set the calling convention of the runtime function.
2273+
assert(!UnimplementedFeature::setCallingConv());
2274+
22652275
mlir::cir::FuncType FTy = CGF.getBuilder().getFuncType(
22662276
{VoidPtrTy, RTTIPtrTy, RTTIPtrTy, PtrDiffTy}, VoidPtrTy);
22672277
return CGF.CGM.getOrCreateRuntimeFunction(FTy, "__dynamic_cast");

clang/lib/CIR/CodeGen/UnimplementedFeatureGuarding.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ struct UnimplementedFeature {
147147
static bool isSEHTryScope() { return false; }
148148
static bool emitScalarRangeCheck() { return false; }
149149
static bool stmtExprEvaluation() { return false; }
150+
static bool setCallingConv() { return false; }
150151
};
151152
} // namespace cir
152153

0 commit comments

Comments
 (0)