[NFC][IR][AsmWriter] Fix Wreturn-type gcc warning
authorYang Fan <nullptr.cpp@gmail.com>
Thu, 28 Jan 2021 07:57:54 +0000 (15:57 +0800)
committerYang Fan <nullptr.cpp@gmail.com>
Thu, 28 Jan 2021 08:42:30 +0000 (16:42 +0800)
GCC warning:
```
/llvm-project/llvm/lib/IR/AsmWriter.cpp:3175:1: warning: control reaches end of non-void function [-Wreturn-type]
 3175 | }
      | ^
```

llvm/lib/IR/AsmWriter.cpp

index 777c240..477ed20 100644 (file)
@@ -3172,6 +3172,7 @@ static const char *getVisibilityName(GlobalValue::VisibilityTypes Vis) {
   case GlobalValue::ProtectedVisibility:
     return "protected";
   }
+  llvm_unreachable("invalid visibility");
 }
 
 void AssemblyWriter::printFunctionSummary(const FunctionSummary *FS) {