[cfe-commits] [PATCH] Don't warn on fall-through from unreachable code.

Richard Smith richard at metafoo.co.uk
Fri Jan 25 16:57:44 PST 2013


  Have you considered restructuring DiagnoseSwitchLabelsFallthrough to perform a recursive walk over just the blocks reachable from the entry block, instead of checking reachability with a separate pass?


================
Comment at: lib/Sema/AnalysisBasedWarnings.cpp:716-717
@@ +715,4 @@
+          ReachableBlocks.insert(P);
+          std::copy(P->succ_begin(), P->succ_end(),
+                    std::back_inserter(BlockQueue));
+        }
----------------
You should only do this the first time you add the block to ReachableBlocks.


http://llvm-reviews.chandlerc.com/D330



More information about the cfe-commits mailing list