[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:06 PDT 2026


================
@@ -625,10 +625,20 @@ void CIRGenFunction::finishIndirectBranch() {
     succesors.push_back(labelOp->getBlock());
     rangeOperands.push_back(labelOp->getBlock()->getArguments());
   }
+  // Labels whose address was taken only from a constant initializer have no
+  // function-local BlockAddressOp; add them as successors here.  All labels
+  // are emitted by now, so the lookup resolves.
+  for (cir::BlockAddrInfoAttr info : constBlockAddressLabels) {
----------------
adams381 wrote:

Done -- there's now one `indirectGotoTargets` vector of `BlockAddrInfoAttr`, resolved in a single loop in finishIndirectBranch. The `BlockAddressOp`->`LabelOp` map and the map/unresolved/resolved helpers are gone.

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


More information about the cfe-commits mailing list