[IR] Fix -Wreturn-type after D135714 "[MemProf] ThinLTO summary support"
authorFangrui Song <i@maskray.me>
Tue, 15 Nov 2022 17:55:28 +0000 (09:55 -0800)
committerFangrui Song <i@maskray.me>
Tue, 15 Nov 2022 17:55:29 +0000 (09:55 -0800)
llvm/lib/IR/AsmWriter.cpp

index 5567232..2f4ebcf 100644 (file)
@@ -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");
   };