[clang] [CIR] Upstream support for references (PR #138001)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 30 10:55:40 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);
----------------
erichkeane wrote:
Why did the 'alignment source' change here? Is that expected?
https://github.com/llvm/llvm-project/pull/138001
More information about the cfe-commits
mailing list