================ @@ -165,6 +165,33 @@ LValue CIRGenFunction::emitDeclRefLValue(const DeclRefExpr *e) { return LValue(); } +/// Emit code to compute the specified expression which +/// can have any type. The result is returned as an RValue struct. +RValue CIRGenFunction::emitAnyExpr(const Expr *e, bool ignoreResult) { + switch (CIRGenFunction::getEvaluationKind(e->getType())) { + case cir::TEK_Scalar: + return RValue::get(emitScalarExpr(e)); + case cir::TEK_Complex: + cgm.errorNYI(e->getSourceRange(), "emitAnyExpr: complex type"); + return RValue::get(nullptr); + case cir::TEK_Aggregate: + cgm.errorNYI(e->getSourceRange(), "emitAnyExpr: aggregate type"); + return RValue::get(nullptr); + } + llvm_unreachable("bad evaluation kind"); +} + +/// Emit code to compute the specified expression, ignoring the result. +void CIRGenFunction::emitIgnoredExpr(const Expr *e) { + if (e->isPRValue()) { + assert(!cir::MissingFeatures::aggValueSlot()); + return (void)emitAnyExpr(e, true); ---------------- erichkeane wrote:
hah, this line is perhaps overly cute. https://github.com/llvm/llvm-project/pull/130869 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits