[llvm] 00c2235 - [IR] Fix -Wreturn-type after D135714 "[MemProf] ThinLTO summary support"

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 15 09:55:36 PST 2022


Author: Fangrui Song
Date: 2022-11-15T09:55:29-08:00
New Revision: 00c22351ba697dbddb4b5bf0ad94e4bcea4b316b

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

LOG: [IR] Fix -Wreturn-type after D135714 "[MemProf] ThinLTO summary support"

Added: 
    

Modified: 
    llvm/lib/IR/AsmWriter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 55672320e1df..2f4ebcf26e6e 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -3197,20 +3197,16 @@ void AssemblyWriter::printFunctionSummary(const FunctionSummary *FS) {
   // "notcoldandcold" implies there are multiple contexts which reach this site,
   // some of which are cold and some of which are not, and that need to
   // disambiguate via cloning or other context identification.
-  auto AllocTypeName = [](uint8_t Type) {
+  auto AllocTypeName = [](uint8_t Type) -> const char * {
     switch (Type) {
     case (uint8_t)AllocationType::None:
       return "none";
-      break;
     case (uint8_t)AllocationType::NotCold:
       return "notcold";
-      break;
     case (uint8_t)AllocationType::Cold:
       return "cold";
-      break;
     case (uint8_t)AllocationType::NotCold | (uint8_t)AllocationType::Cold:
       return "notcoldandcold";
-      break;
     }
     llvm_unreachable("Unexpected alloc type");
   };


        


More information about the llvm-commits mailing list