[llvm] a340d47 - [ProfileData] Fix a warning

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 9 10:34:10 PST 2021


Author: Kazu Hirata
Date: 2021-11-09T10:34:00-08:00
New Revision: a340d474192f6e0bec9cb493af162bf1abaa73d5

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

LOG: [ProfileData] Fix a warning

This patch fixes:

  llvm/lib/ProfileData/InstrProf.cpp:146:3: error: default label in
  switch which covers all enumeration values
  [-Werror,-Wcovered-switch-default]

Added: 
    

Modified: 
    llvm/lib/ProfileData/InstrProf.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp
index de5ba33b6ad4..6bd02abfe1e5 100644
--- a/llvm/lib/ProfileData/InstrProf.cpp
+++ b/llvm/lib/ProfileData/InstrProf.cpp
@@ -143,9 +143,6 @@ static std::string getInstrProfErrString(instrprof_error Err,
     OS << "profile uses zlib compression but the profile reader was built "
           "without zlib support";
     break;
-  default:
-    llvm_unreachable("A value of instrprof_error has no message.");
-    break;
   }
 
   // If optional error message is not empty, append it to the message.


        


More information about the llvm-commits mailing list