From: Mikael Holmen Date: Fri, 5 Jul 2019 06:12:24 +0000 (+0000) Subject: Silence gcc warning "control reaches end of non-void function" [NFCI] X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc2f89f72d6ac47fb9584e2a437350f74fb95e29;p=clang Silence gcc warning "control reaches end of non-void function" [NFCI] Without this fix gcc (7.4) complains with /data/repo/master/clang/lib/CodeGen/CGObjCMac.cpp: In member function 'std::__cxx11::string {anonymous}::CGObjCCommonMac::GetSectionName(llvm::StringRef, llvm::StringRef)': /data/repo/master/clang/lib/CodeGen/CGObjCMac.cpp:4944:1: error: control reaches end of non-void function [-Werror=return-type] } ^ All values in the ObjectFormatType enum are currently handled in the switch but gcc complains anyway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365174 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 37b9b40b1d..12880fecba 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -4941,6 +4941,8 @@ std::string CGObjCCommonMac::GetSectionName(StringRef Section, llvm::report_fatal_error( "Objective-C support is unimplemented for object file format."); } + + llvm_unreachable("Unhandled llvm::Triple::ObjectFormatType enum"); } /// EmitImageInfo - Emit the image info marker used to encode some module