llvm-project/clang/lib/Basic
Reid Kleckner 4dc0b1ac60 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

llvm-svn: 345882
2018-11-01 19:54:45 +00:00
..
Targets Fix clang -Wimplicit-fallthrough warnings across llvm, NFC 2018-11-01 19:54:45 +00:00
Attributes.cpp Support accepting __gnu__ as a scoped attribute namespace that aliases to gnu. 2018-10-24 12:26:23 +00:00
Builtins.cpp NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects) 2018-10-30 20:31:30 +00:00
CMakeLists.txt Lift VFS from clang to llvm (NFC) 2018-10-10 13:27:25 +00:00
CharInfo.cpp
Cuda.cpp Add gfx909 to GPU Arch 2018-10-24 21:19:02 +00:00
Diagnostic.cpp Add a newline to SourceLocation dump output 2018-08-15 20:32:06 +00:00
DiagnosticIDs.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
DiagnosticOptions.cpp [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-02-16 23:40:07 +00:00
FileManager.cpp Lift VFS from clang to llvm (NFC) 2018-10-10 13:27:25 +00:00
FileSystemStatCache.cpp Lift VFS from clang to llvm (NFC) 2018-10-10 13:27:25 +00:00
FixedPoint.cpp Fix for broken build on clang-hexagon-elf for ambiguous call to 2018-08-06 19:31:00 +00:00
IdentifierTable.cpp Fix clang -Wimplicit-fallthrough warnings across llvm, NFC 2018-11-01 19:54:45 +00:00
LangOptions.cpp [OpenCL] Factor out language version printing 2018-05-08 13:47:43 +00:00
MemoryBufferCache.cpp Reapply "Modules: Cache PCMs in memory and avoid a use-after-free" 2017-03-20 17:58:26 +00:00
Module.cpp NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects) 2018-10-30 20:31:30 +00:00
ObjCRuntime.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
OpenMPKinds.cpp Add support for 'dynamic_allocators' clause on 'requires' directive. Differential Revision: https://reviews.llvm.org/D53079 2018-10-11 14:41:10 +00:00
OperatorPrecedence.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
SanitizerBlacklist.cpp Allow specifying sanitizers in blacklists 2017-09-25 22:11:12 +00:00
SanitizerSpecialCaseList.cpp Update SanitizerSpecialCaseList to use renamed functions in base class. 2017-11-07 21:16:37 +00:00
Sanitizers.cpp [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-03-28 22:09:09 +00:00
SourceLocation.cpp Add dump() method for SourceRange 2018-08-30 23:10:52 +00:00
SourceManager.cpp Lift VFS from clang to llvm (NFC) 2018-10-10 13:27:25 +00:00
TargetInfo.cpp [Android] Increase default new alignment for Android 2018-08-01 17:55:34 +00:00
Targets.cpp Use the container form llvm::sort(C, ...) 2018-09-30 21:41:11 +00:00
Targets.h NFC: Add the emacs c++ mode hint "-*- C++ -*-" to the headers that don't have it 2018-07-24 00:07:49 +00:00
TokenKinds.cpp
Version.cpp
Warnings.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
XRayInstr.cpp [XRay] Add clang builtin for xray typed events. 2018-04-17 21:32:43 +00:00
XRayLists.cpp [XRay][llvm+clang] Consolidate attribute list files 2018-04-09 04:02:09 +00:00