[cfe-commits] [PATCH] Compatibility macro detection for the -Wimplicit-fallthrough diagnostic.

Alexander Kornienko reviews at llvm-reviews.chandlerc.com
Wed Sep 26 08:17:56 PDT 2012


Hi doug.gregor, rsmith,

When issuing a diagnostic message for the -Wimplicit-fallthrough diagnostics, always try to find the latest macro, defined at the point of fallthrough, which is immediately expanded to "[[clang::fallthrough]]", and use it's name instead of the actual sequence.

Known issues: 
  * uses PP.getSpelling() to compare macro definition with a string (anyone can suggest a convenient way to fill a token array, or maybe lex it in runtime?);
  * this can be generalized and used in other similar cases, any ideas where it should reside then?

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

Files:
  tools/clang/test/SemaCXX/switch-implicit-fallthrough-macro.cpp
  tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
  tools/clang/include/clang/Lex/MacroInfo.h
  tools/clang/lib/Sema/AnalysisBasedWarnings.cpp
  tools/clang/lib/Lex/MacroInfo.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50.1.patch
Type: text/x-patch
Size: 9597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120926/beeb1fb3/attachment.bin>


More information about the cfe-commits mailing list