[clang] [CIR] Upstream support for references (PR #138001)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 30 11:05:13 PDT 2025
================
@@ -439,7 +439,13 @@ LValue CIRGenFunction::emitDeclRefLValue(const DeclRefExpr *e) {
cgm.errorNYI(e->getSourceRange(), "emitDeclRefLValue: static local");
}
- return makeAddrLValue(addr, ty, AlignmentSource::Type);
+ // Drill into reference types.
+ LValue lv =
+ vd->getType()->isReferenceType()
+ ? emitLoadOfReferenceLValue(addr, getLoc(e->getSourceRange()),
+ vd->getType(), AlignmentSource::Decl)
+ : makeAddrLValue(addr, ty, AlignmentSource::Decl);
----------------
andykaylor wrote:
It was just wrong before. This now matches what is in both the incubator and classic codegen.
https://github.com/llvm/llvm-project/pull/138001
More information about the cfe-commits
mailing list