Skip to content

Commit 7e1968a

Browse files
Apply reviews
1 parent 3e24f4b commit 7e1968a

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID,
454454
cgm.getTypes().arrangeGlobalDeclaration(gd));
455455
const auto *nd = cast<NamedDecl>(gd.getDecl());
456456
cir::FuncOp fnOp =
457-
cgm.getOrCreateCIRFunction(nd->getName(), ty, gd, /*ForVTable=*/false,
458-
/*DontDefer=*/false);
457+
cgm.getOrCreateCIRFunction(nd->getName(), ty, gd, /*ForVTable=*/false);
459458
fnOp.setBuiltin(true);
460459
return emitCall(e->getCallee()->getType(), CIRGenCallee::forDirect(fnOp), e,
461460
returnValue);

clang/lib/CIR/CodeGen/CIRGenCoroutine.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,14 @@ cir::CallOp CIRGenFunction::emitCoroIDBuiltinCall(mlir::Location loc,
6969

7070
cir::CallOp CIRGenFunction::emitCoroAllocBuiltinCall(mlir::Location loc) {
7171
cir::BoolType boolTy = builder.getBoolTy();
72-
cir::IntType int32Ty = builder.getUInt32Ty();
7372

7473
mlir::Operation *builtin = cgm.getGlobalValue(cgm.builtinCoroAlloc);
7574

7675
cir::FuncOp fnOp;
7776
if (!builtin) {
7877
fnOp = cgm.createCIRBuiltinFunction(loc, cgm.builtinCoroAlloc,
79-
cir::FuncType::get({int32Ty}, boolTy),
80-
/*FD=*/nullptr);
78+
cir::FuncType::get({UInt32Ty}, boolTy),
79+
/*fd=*/nullptr);
8180
assert(fnOp && "should always succeed");
8281
} else {
8382
fnOp = cast<cir::FuncOp>(builtin);
@@ -90,15 +89,14 @@ cir::CallOp CIRGenFunction::emitCoroAllocBuiltinCall(mlir::Location loc) {
9089
cir::CallOp
9190
CIRGenFunction::emitCoroBeginBuiltinCall(mlir::Location loc,
9291
mlir::Value coroframeAddr) {
93-
cir::IntType int32Ty = builder.getUInt32Ty();
9492
mlir::Operation *builtin = cgm.getGlobalValue(cgm.builtinCoroBegin);
9593

9694
cir::FuncOp fnOp;
9795
if (!builtin) {
9896
fnOp = cgm.createCIRBuiltinFunction(
9997
loc, cgm.builtinCoroBegin,
100-
cir::FuncType::get({int32Ty, VoidPtrTy}, VoidPtrTy),
101-
/*FD=*/nullptr);
98+
cir::FuncType::get({UInt32Ty, VoidPtrTy}, VoidPtrTy),
99+
/*fd=*/nullptr);
102100
assert(fnOp && "should always succeed");
103101
} else {
104102
fnOp = cast<cir::FuncOp>(builtin);
@@ -149,7 +147,7 @@ CIRGenFunction::emitCoroutineBody(const CoroutineBodyStmt &s) {
149147

150148
// Handle allocation failure if 'ReturnStmtOnAllocFailure' was provided.
151149
if (s.getReturnStmtOnAllocFailure())
152-
cgm.errorNYI("NYI");
150+
cgm.errorNYI("handle coroutine return alloc failure");
153151

154152
assert(!cir::MissingFeatures::generateDebugInfo());
155153
assert(!cir::MissingFeatures::emitBodyAndFallthrough());

0 commit comments

Comments
 (0)