[clang] b1a8dcf - Silence some "not all control paths return a value" warnings; NFC

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 23 06:19:05 PST 2022


Author: Aaron Ballman
Date: 2022-02-23T09:18:56-05:00
New Revision: b1a8dcf8c186ddfeeb062ab8475fe30365557955

URL: https://github.com/llvm/llvm-project/commit/b1a8dcf8c186ddfeeb062ab8475fe30365557955
DIFF: https://github.com/llvm/llvm-project/commit/b1a8dcf8c186ddfeeb062ab8475fe30365557955.diff

LOG: Silence some "not all control paths return a value" warnings; NFC

Added: 
    

Modified: 
    clang/lib/Frontend/FrontendActions.cpp
    clang/lib/Tooling/Syntax/Pseudo/LRTable.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index baf3ac34db620..65cbc946179f5 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -823,6 +823,7 @@ static StringRef ModuleKindName(Module::ModuleKind MK) {
   case Module::PrivateModuleFragment:
     return "Private Module Fragment";
   }
+  llvm_unreachable("unknown module kind!");
 }
 
 void DumpModuleInfoAction::ExecuteAction() {

diff  --git a/clang/lib/Tooling/Syntax/Pseudo/LRTable.cpp b/clang/lib/Tooling/Syntax/Pseudo/LRTable.cpp
index 2ecb9b1cd2ce2..4a817a527f2fa 100644
--- a/clang/lib/Tooling/Syntax/Pseudo/LRTable.cpp
+++ b/clang/lib/Tooling/Syntax/Pseudo/LRTable.cpp
@@ -31,6 +31,7 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const LRTable::Action &A) {
   case LRTable::Action::Sentinel:
     llvm_unreachable("unexpected Sentinel action kind!");
   }
+  llvm_unreachable("unexpected action kind!");
 }
 
 std::string LRTable::dumpStatistics() const {


        


More information about the cfe-commits mailing list