From e1a9481445cb40e11e144459fb45d64958fb02d1 Mon Sep 17 00:00:00 2001
From: Nico Weber <nicolasweber@gmx.de>
Date: Sat, 20 Jun 2015 00:06:30 +0000
Subject: [PATCH] Suppress bogus gcc -Wreturn-type warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240199 91177308-0d34-0410-b5e6-96231b3b80d8
---
 include/clang/AST/Type.h      | 1 +
 lib/AST/Type.cpp              | 1 +
 lib/Basic/IdentifierTable.cpp | 1 +
 lib/Sema/SemaType.cpp         | 1 +
 4 files changed, 4 insertions(+)

diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index d8212587362..d903b9d8cbc 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -3544,6 +3544,7 @@ public:
     case NullabilityKind::Unspecified:
       return attr_null_unspecified;
     }
+    llvm_unreachable("Unknown nullability kind.");
   }
 
   /// Strip off the top-level nullability annotation on the given
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 15f3d39634d..3ac11719409 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -2466,6 +2466,7 @@ bool Type::canHaveNullability() const {
   case Type::Atomic:
     return false;
   }
+  llvm_unreachable("bad type kind!");
 }
 
 llvm::Optional<NullabilityKind> AttributedType::getImmediateNullability() const {
diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp
index 0349ef463bf..b2950081000 100644
--- a/lib/Basic/IdentifierTable.cpp
+++ b/lib/Basic/IdentifierTable.cpp
@@ -658,4 +658,5 @@ StringRef clang::getNullabilitySpelling(NullabilityKind kind) {
   case NullabilityKind::Unspecified:
     return "__null_unspecified";
   }
+  llvm_unreachable("Unknown nullability kind.");
 }
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 44c925778cb..ff0e26c8402 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -2581,6 +2581,7 @@ IdentifierInfo *Sema::getNullabilityKeyword(NullabilityKind nullability) {
       Ident___null_unspecified = PP.getIdentifierInfo("__null_unspecified");
     return Ident___null_unspecified;
   }
+  llvm_unreachable("Unknown nullability kind.");
 }
 
 /// Retrieve the identifier "NSError".
-- 
GitLab