[clang] [Clang][Sema] Add -Wredundant-defer to diagnose redundant `_Defer`s (PR #225748)

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 2 23:53:38 PDT 2026


================
@@ -430,6 +430,39 @@ void Sema::ActOnFinishOfCompoundStmt() {
   PopCompoundScope();
 }
 
+// Returns the given statement as if its labels and attributes were
+// stripped, if any.
+static Stmt *GetInnermostStatement(Stmt *Outer) {
----------------
Expertcoderz wrote:

Alright, while trying to add it under `Stmt` I realized that there's already an existing `Stmt::stripLabelLikeStatements()` that serves basically the same function. I've deleted the definition of `GetInnermostStatement` and changed all callers to use `Stmt::stripLabelLikeStatements()` instead.

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


More information about the cfe-commits mailing list