llvm-project
b7c6fd35 - [CIR] Support addr-of-label in constant initializer context

Commit
39 days ago
[CIR] Support addr-of-label in constant initializer context Previously, using the GNU address-of-label extension (&&label) in an array initializer like `void *labels[] = {&&a, &&b}` would hit an NYI error in ConstantLValueEmitter::VisitAddrLabelExpr. The scalar expression path already handles &&label correctly via BlockAddressOp. The fix is to return null from the constant emitter, which makes the caller fall through to the non-constant initialization path that emits individual BlockAddressOp stores per element. This is consistent with CIR's approach of preferring non-constant emission to preserve source-level semantics (see CIRGenDecl.cpp:278).
Parents
Loading