Fix clang -Wimplicit-fallthrough warnings across llvm, NFC
commit01cfb5d603604c1369ae4c7015e14b42233b4a23
authorReid Kleckner <rnk@google.com>
Thu, 1 Nov 2018 19:54:45 +0000 (1 19:54 +0000)
committerReid Kleckner <rnk@google.com>
Thu, 1 Nov 2018 19:54:45 +0000 (1 19:54 +0000)
tree35df6f06c22688b60275f825ecaefec36f082f97
parent12145bec215d7b2f28c79659a76e08aa91a7aa39
Fix clang -Wimplicit-fallthrough warnings across llvm, NFC

This patch should not introduce any behavior changes. It consists of
mostly one of two changes:
1. Replacing fall through comments with the LLVM_FALLTHROUGH macro
2. Inserting 'break' before falling through into a case block consisting
   of only 'break'.

We were already using this warning with GCC, but its warning behaves
slightly differently. In this patch, the following differences are
relevant:
1. GCC recognizes comments that say "fall through" as annotations, clang
   doesn't
2. GCC doesn't warn on "case N: foo(); default: break;", clang does
3. GCC doesn't warn when the case contains a switch, but falls through
   the outer case.

I will enable the warning separately in a follow-up patch so that it can
be cleanly reverted if necessary.

Reviewers: alexfh, rsmith, lattner, rtrieu, EricWF, bollu

Differential Revision: https://reviews.llvm.org/D53950

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@345882 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScopBuilder.cpp
lib/Analysis/ScopDetection.cpp