[PATCH] D95595: [NFC] Fix Wreturn-type gcc warning

Yang Fan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 23:58:52 PST 2021


nullptr.cpp created this revision.
Herald added subscribers: dexonsmith, hiraditya.
nullptr.cpp requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

GCC warning:

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95595

Files:
  llvm/lib/IR/AsmWriter.cpp


Index: llvm/lib/IR/AsmWriter.cpp
===================================================================
--- llvm/lib/IR/AsmWriter.cpp
+++ llvm/lib/IR/AsmWriter.cpp
@@ -3172,6 +3172,7 @@
   case GlobalValue::ProtectedVisibility:
     return "protected";
   }
+  llvm_unreachable("invalid visibility");
 }
 
 void AssemblyWriter::printFunctionSummary(const FunctionSummary *FS) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95595.319774.patch
Type: text/x-patch
Size: 375 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210128/95cfceaf/attachment.bin>


More information about the llvm-commits mailing list