================ @@ -1482,3 +1482,10 @@ bool CapturedStmt::capturesVariable(const VarDecl *Var) const { return false; } + +Stmt *LoopControlStmt::getLabelTarget() const { + Stmt *Target = TargetLabel->getStmt(); + while (isa_and_present<LabelStmt>(Target)) + Target = cast<LabelStmt>(Target)->getSubStmt(); + return Target; ---------------- Sirraide wrote:
I’ve added `getInnermostLabeledStmt()` because it seems like a useful thing to have, and I’ve renamed this function to `getNamedLoopOrSwitch()` to avoid having to write `getLabelDecl()->getStmt()->getInnermostLabeledStmt()` in a number of places. https://github.com/llvm/llvm-project/pull/152870 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits