[llvm] fc4e8a3 - [NFC][IR][AsmWriter] Fix Wreturn-type gcc warning

Yang Fan via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 00:43:23 PST 2021


Author: Yang Fan
Date: 2021-01-28T16:42:30+08:00
New Revision: fc4e8a3e8b4aa9a8aaa9cb8ebc44c7fda465648b

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

LOG: [NFC][IR][AsmWriter] Fix Wreturn-type gcc warning

GCC warning:
```
/llvm-project/llvm/lib/IR/AsmWriter.cpp:3175:1: warning: control reaches end of non-void function [-Wreturn-type]
 3175 | }
      | ^
```

Added: 
    

Modified: 
    llvm/lib/IR/AsmWriter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 777c240f01c8..477ed20d868a 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -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) {


        


More information about the llvm-commits mailing list