[clang] [CIR] Wire const goto labels into indirect branch (PR #201644)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 25 10:05:07 PDT 2026


================
@@ -1564,6 +1576,11 @@ void CIRGenFunction::instantiateIndirectGotoBlock() {
                           {builder.getUnknownLoc()});
 }
 
+void CIRGenFunction::takeAddressOfConstantLabel(cir::BlockAddrInfoAttr info) {
+  constBlockAddressLabels.push_back(info);
+  instantiateIndirectGotoBlock();
----------------
adams381 wrote:

Moved instantiation to `emitIndirectGotoStmt`, so a function that takes a label address but never does `goto *` emits no indirect branch (no more poison fallback). That diverges from classic, which still emits a dead poisoned indirectbr; `h` and `E` (label-values.c) cover it.

https://github.com/llvm/llvm-project/pull/201644


More information about the cfe-commits mailing list