[clang] [CIR] Wire const goto labels into indirect branch (PR #201644)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 24 17:21:01 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) {
----------------
andykaylor wrote:
I think you can replace the `blockAddressToLabel` map with a single vector of indirect goto targets as `BlockAddrInfoAttr` in CGF, and you can get rid of the whole `mapUnresolvedBlockAddress`, `mapResolvedBlockAddress`, `updateResolvedBlockAddress` business because it's not really necessary. Then you get one container and one loop here.
https://github.com/llvm/llvm-project/pull/201644
More information about the cfe-commits
mailing list