Skip to content

Commit 324b521

Browse files
committed
Address code review comments
1 parent 118f922 commit 324b521

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,17 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID,
6767
cgm.getBuiltinLibFunction(fd, builtinID));
6868

6969
mlir::Location loc = getLoc(e->getExprLoc());
70+
7071
switch (builtinID) {
7172
case Builtin::BI__builtin_complex: {
7273
mlir::Value real = emitScalarExpr(e->getArg(0));
7374
mlir::Value imag = emitScalarExpr(e->getArg(1));
7475
mlir::Value complex = builder.createComplexCreate(loc, real, imag);
7576
return RValue::get(complex);
7677
}
77-
default:
78-
cgm.errorNYI(loc, "non constant foldable builtin calls");
7978
}
79+
80+
cgm.errorNYI(loc, "non constant foldable builtin calls");
8081
return getUndefRValue(e->getType());
8182
}
8283

clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ mlir::Value ComplexExprEmitter::emitLoadOfLValue(LValue lv,
5252
SourceLocation loc) {
5353
assert(lv.isSimple() && "non-simple complex l-value?");
5454
if (lv.getType()->isAtomicType())
55-
cgf.cgm.errorNYI("emitLoadOfLValue with Atomic LV");
55+
cgf.cgm.errorNYI(loc, "emitLoadOfLValue with Atomic LV");
5656

5757
const Address srcAddr = lv.getAddress();
5858
return builder.createLoad(cgf.getLoc(loc), srcAddr);
@@ -62,7 +62,7 @@ void ComplexExprEmitter::emitStoreOfComplex(mlir::Location loc, mlir::Value val,
6262
LValue lv, bool isInit) {
6363
if (lv.getType()->isAtomicType() ||
6464
(!isInit && cgf.isLValueSuitableForInlineAtomic(lv))) {
65-
cgf.cgm.errorNYI("StoreOfComplex with Atomic LV");
65+
cgf.cgm.errorNYI(loc, "StoreOfComplex with Atomic LV");
6666
return;
6767
}
6868

clang/test/CIR/CodeGen/complex.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ void foo8() {
191191
// OGCG: store double 0.000000e+00, ptr %[[C_REAL_PTR]], align 8
192192
// OGCG: store double 2.000000e+00, ptr %[[C_IMAG_PTR]], align 8
193193

194-
void foo9(double r, double i) {
195-
double _Complex c = __builtin_complex(r, i);
194+
void foo9(double a, double b) {
195+
double _Complex c = __builtin_complex(a, b);
196196
}
197197

198198
// CIR: %[[INIT:.*]] = cir.alloca !cir.complex<!cir.double>, !cir.ptr<!cir.complex<!cir.double>>, ["c", init]

0 commit comments

Comments
 (0)