Author: rnk Date: Thu Nov 1 12:54:45 2018 New Revision: 345882 URL: http://llvm.org/viewvc/llvm-project?rev=345882&view=rev Log: 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 Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp lldb/trunk/tools/lldb-test/lldb-test.cpp Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=345882&r1=345881&r2=345882&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Thu Nov 1 12:54:45 2018 @@ -288,6 +288,7 @@ GetClassOrFunctionParent(const llvm::pdb auto class_parent_id = raw.getClassParentId(); if (auto class_parent = session.getSymbolById(class_parent_id)) return class_parent; + break; } default: break; Modified: lldb/trunk/tools/lldb-test/lldb-test.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-test/lldb-test.cpp?rev=345882&r1=345881&r2=345882&view=diff ============================================================================== --- lldb/trunk/tools/lldb-test/lldb-test.cpp (original) +++ lldb/trunk/tools/lldb-test/lldb-test.cpp Thu Nov 1 12:54:45 2018 @@ -285,7 +285,7 @@ std::string opts::breakpoint::substitute OS << sys::path::parent_path(breakpoint::CommandFile); break; } - // fall through + LLVM_FALLTHROUGH; default: size_t pos = Cmd.find('%'); OS << Cmd.substr(0, pos); _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits