summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ASTImporter.cpp11
-rw-r--r--clang/lib/AST/Decl.cpp3
-rw-r--r--clang/lib/AST/DeclBase.cpp2
-rw-r--r--clang/lib/AST/DeclarationName.cpp5
-rw-r--r--clang/lib/AST/DumpXML.cpp1
-rw-r--r--clang/lib/AST/Expr.cpp11
-rw-r--r--clang/lib/AST/ExprClassification.cpp3
-rw-r--r--clang/lib/AST/ExprConstant.cpp10
-rw-r--r--clang/lib/AST/ItaniumMangle.cpp3
-rw-r--r--clang/lib/AST/NestedNameSpecifier.cpp17
-rw-r--r--clang/lib/AST/Stmt.cpp2
-rw-r--r--clang/lib/AST/StmtProfile.cpp1
-rw-r--r--clang/lib/AST/TemplateBase.cpp28
-rw-r--r--clang/lib/AST/Type.cpp6
-rw-r--r--clang/lib/AST/TypeLoc.cpp97
-rw-r--r--clang/lib/AST/TypePrinter.cpp2
16 files changed, 79 insertions, 123 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index 10f5a206d5b..abf214aa1a1 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/lib/AST/ASTImporter.cpp
@@ -332,7 +332,6 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context,
}
llvm_unreachable("Invalid template argument kind");
- return true;
}
/// \brief Determine structural equivalence for the common part of array
@@ -1357,8 +1356,8 @@ QualType ASTNodeImporter::VisitBuiltinType(const BuiltinType *T) {
// wchar_t?
return Importer.getToContext().WCharTy;
}
-
- return QualType();
+
+ llvm_unreachable("Invalid BuiltinType Kind!");
}
QualType ASTNodeImporter::VisitComplexType(const ComplexType *T) {
@@ -1983,7 +1982,6 @@ ASTNodeImporter::ImportTemplateArgument(const TemplateArgument &From) {
}
llvm_unreachable("Invalid template argument kind");
- return TemplateArgument();
}
bool ASTNodeImporter::ImportTemplateArguments(const TemplateArgument *FromArgs,
@@ -4214,7 +4212,6 @@ NestedNameSpecifier *ASTImporter::Import(NestedNameSpecifier *FromNNS) {
}
llvm_unreachable("Invalid nested name specifier kind");
- return 0;
}
NestedNameSpecifierLoc ASTImporter::Import(NestedNameSpecifierLoc FromNNS) {
@@ -4309,7 +4306,6 @@ TemplateName ASTImporter::Import(TemplateName From) {
}
llvm_unreachable("Invalid template name kind");
- return TemplateName();
}
SourceLocation ASTImporter::Import(SourceLocation FromLoc) {
@@ -4453,8 +4449,7 @@ DeclarationName ASTImporter::Import(DeclarationName FromName) {
return DeclarationName::getUsingDirectiveName();
}
- // Silence bogus GCC warning
- return DeclarationName();
+ llvm_unreachable("Invalid DeclarationName Kind!");
}
IdentifierInfo *ASTImporter::Import(const IdentifierInfo *FromId) {
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 001620a611b..49227e91958 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -48,8 +48,6 @@ static llvm::Optional<Visibility> getVisibilityOf(const Decl *D) {
case VisibilityAttr::Protected:
return ProtectedVisibility;
}
-
- return DefaultVisibility;
}
// If we're on Mac OS X, an 'availability' for Mac OS X attribute
@@ -1141,7 +1139,6 @@ const char *VarDecl::getStorageClassSpecifierString(StorageClass SC) {
}
llvm_unreachable("Invalid storage class");
- return 0;
}
VarDecl *VarDecl::Create(ASTContext &C, DeclContext *DC,
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 3763ebd2f7d..da54a44784e 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -529,7 +529,7 @@ unsigned Decl::getIdentifierNamespaceForKind(Kind DeclKind) {
return 0;
}
- return 0;
+ llvm_unreachable("Invalid DeclKind!");
}
void Decl::setAttrs(const AttrVec &attrs) {
diff --git a/clang/lib/AST/DeclarationName.cpp b/clang/lib/AST/DeclarationName.cpp
index bf647ed7ac3..a5488e67ca2 100644
--- a/clang/lib/AST/DeclarationName.cpp
+++ b/clang/lib/AST/DeclarationName.cpp
@@ -125,8 +125,8 @@ int DeclarationName::compare(DeclarationName LHS, DeclarationName RHS) {
case DeclarationName::CXXUsingDirective:
return 0;
}
-
- return 0;
+
+ llvm_unreachable("Invalid DeclarationName Kind!");
}
} // end namespace clang
@@ -189,7 +189,6 @@ DeclarationName::NameKind DeclarationName::getNameKind() const {
return ObjCMultiArgSelector;
}
- break;
}
// Can't actually get here.
diff --git a/clang/lib/AST/DumpXML.cpp b/clang/lib/AST/DumpXML.cpp
index 9dd5a010f08..c5e23ccc6ea 100644
--- a/clang/lib/AST/DumpXML.cpp
+++ b/clang/lib/AST/DumpXML.cpp
@@ -165,7 +165,6 @@ static StringRef getTypeKindName(Type *T) {
}
llvm_unreachable("unknown type kind!");
- return "unknown_type";
}
struct XMLDumper : public XMLDeclVisitor<XMLDumper>,
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 7fc07003115..a92dafb2732 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -124,7 +124,6 @@ SourceLocation Expr::getExprLoc() const {
#include "clang/AST/StmtNodes.inc"
}
llvm_unreachable("unknown statement kind");
- return SourceLocation();
}
//===----------------------------------------------------------------------===//
@@ -1213,7 +1212,6 @@ const char *CastExpr::getCastKindName() const {
}
llvm_unreachable("Unhandled cast kind!");
- return 0;
}
Expr *CastExpr::getSubExprAsWritten() {
@@ -1255,7 +1253,6 @@ CXXBaseSpecifier **CastExpr::path_buffer() {
#include "clang/AST/StmtNodes.inc"
default:
llvm_unreachable("non-cast expressions not possible here");
- return 0;
}
}
@@ -1343,7 +1340,7 @@ const char *BinaryOperator::getOpcodeStr(Opcode Op) {
case BO_Comma: return ",";
}
- return "";
+ llvm_unreachable("Invalid OpCode!");
}
BinaryOperatorKind
@@ -3015,7 +3012,7 @@ SourceRange ObjCMessageExpr::getReceiverRange() const {
return getSuperLoc();
}
- return SourceLocation();
+ llvm_unreachable("Invalid ReceiverKind!");
}
Selector ObjCMessageExpr::getSelector() const {
@@ -3064,8 +3061,8 @@ StringRef ObjCBridgedCastExpr::getBridgeKindName() const {
case OBC_BridgeRetained:
return "__bridge_retained";
}
-
- return "__bridge";
+
+ llvm_unreachable("Invalid BridgeKind!");
}
bool ChooseExpr::isConditionTrue(const ASTContext &C) const {
diff --git a/clang/lib/AST/ExprClassification.cpp b/clang/lib/AST/ExprClassification.cpp
index 60e6f96c963..311b8054714 100644
--- a/clang/lib/AST/ExprClassification.cpp
+++ b/clang/lib/AST/ExprClassification.cpp
@@ -47,7 +47,6 @@ static Cl::Kinds ClassifyExprValueKind(const LangOptions &Lang,
return Cl::CL_XValue;
}
llvm_unreachable("Invalid value category of implicit cast.");
- return Cl::CL_PRValue;
}
Cl Expr::ClassifyImpl(ASTContext &Ctx, SourceLocation *Loc) const {
@@ -99,7 +98,6 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) {
#define EXPR(Kind, Base)
#include "clang/AST/StmtNodes.inc"
llvm_unreachable("cannot classify a statement");
- break;
// First come the expressions that are always lvalues, unconditionally.
case Expr::ObjCIsaExprClass:
@@ -371,7 +369,6 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) {
}
llvm_unreachable("unhandled expression kind in classification");
- return Cl::CL_LValue;
}
/// ClassifyDecl - Return the classification of an expression referencing the
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 5d614069590..bdedb1608ed 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -3756,7 +3756,6 @@ static int EvaluateBuiltinClassifyType(const CallExpr *E) {
return union_type_class;
else // FIXME: offset_type_class, method_type_class, & lang_type_class?
llvm_unreachable("CallExpr::isBuiltinClassifyType(): unimplemented type");
- return -1;
}
/// EvaluateBuiltinConstantPForLValue - Determine the result of
@@ -4385,7 +4384,6 @@ bool IntExprEvaluator::VisitUnaryExprOrTypeTraitExpr(
}
llvm_unreachable("unknown expr/type trait");
- return Error(E);
}
bool IntExprEvaluator::VisitOffsetOfExpr(const OffsetOfExpr *OOE) {
@@ -4427,7 +4425,6 @@ bool IntExprEvaluator::VisitOffsetOfExpr(const OffsetOfExpr *OOE) {
case OffsetOfExpr::OffsetOfNode::Identifier:
llvm_unreachable("dependent __builtin_offsetof");
- return Error(OOE);
case OffsetOfExpr::OffsetOfNode::Base: {
CXXBaseSpecifier *BaseSpec = ON.getBase();
@@ -4618,7 +4615,6 @@ bool IntExprEvaluator::VisitCastExpr(const CastExpr *E) {
}
llvm_unreachable("unknown cast resulting in integral value");
- return Error(E);
}
bool IntExprEvaluator::VisitUnaryReal(const UnaryOperator *E) {
@@ -4881,8 +4877,6 @@ bool FloatExprEvaluator::VisitCastExpr(const CastExpr *E) {
return true;
}
}
-
- return Error(E);
}
//===----------------------------------------------------------------------===//
@@ -5092,7 +5086,6 @@ bool ComplexExprEvaluator::VisitCastExpr(const CastExpr *E) {
}
llvm_unreachable("unknown cast resulting in complex value");
- return Error(E);
}
bool ComplexExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) {
@@ -5928,8 +5921,7 @@ static ICEDiag CheckICE(const Expr* E, ASTContext &Ctx) {
}
}
- // Silence a GCC warning
- return ICEDiag(2, E->getLocStart());
+ llvm_unreachable("Invalid StmtClass!");
}
/// Evaluate an expression as a C++11 integral constant expression.
diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp
index 7f2d5628a88..427be32a460 100644
--- a/clang/lib/AST/ItaniumMangle.cpp
+++ b/clang/lib/AST/ItaniumMangle.cpp
@@ -1370,7 +1370,6 @@ void CXXNameMangler::mangleType(TemplateName TN) {
case TemplateName::OverloadedTemplate:
llvm_unreachable("can't mangle an overloaded template name as a <type>");
- break;
case TemplateName::DependentTemplate: {
const DependentTemplateName *Dependent = TN.getAsDependentTemplateName();
@@ -1741,7 +1740,6 @@ void CXXNameMangler::mangleType(const BuiltinType *T) {
#include "clang/AST/BuiltinTypes.def"
case BuiltinType::Dependent:
llvm_unreachable("mangling a placeholder type");
- break;
case BuiltinType::ObjCId: Out << "11objc_object"; break;
case BuiltinType::ObjCClass: Out << "10objc_class"; break;
case BuiltinType::ObjCSel: Out << "13objc_selector"; break;
@@ -2226,7 +2224,6 @@ recurse:
case Expr::ParenListExprClass:
case Expr::CXXScalarValueInitExprClass:
llvm_unreachable("unexpected statement kind");
- break;
// FIXME: invent manglings for all these.
case Expr::BlockExprClass:
diff --git a/clang/lib/AST/NestedNameSpecifier.cpp b/clang/lib/AST/NestedNameSpecifier.cpp
index 858cf12dc66..c59d40a8c2b 100644
--- a/clang/lib/AST/NestedNameSpecifier.cpp
+++ b/clang/lib/AST/NestedNameSpecifier.cpp
@@ -130,7 +130,7 @@ NestedNameSpecifier::SpecifierKind NestedNameSpecifier::getKind() const {
return TypeSpecWithTemplate;
}
- return Global;
+ llvm_unreachable("Invalid NNS Kind!");
}
/// \brief Retrieve the namespace stored in this nested name
@@ -170,8 +170,7 @@ bool NestedNameSpecifier::isDependent() const {
return getAsType()->isDependentType();
}
- // Necessary to suppress a GCC warning.
- return false;
+ llvm_unreachable("Invalid NNS Kind!");
}
/// \brief Whether this nested name specifier refers to a dependent
@@ -191,9 +190,8 @@ bool NestedNameSpecifier::isInstantiationDependent() const {
case TypeSpecWithTemplate:
return getAsType()->isInstantiationDependentType();
}
-
- // Necessary to suppress a GCC warning.
- return false;
+
+ llvm_unreachable("Invalid NNS Kind!");
}
bool NestedNameSpecifier::containsUnexpandedParameterPack() const {
@@ -211,8 +209,7 @@ bool NestedNameSpecifier::containsUnexpandedParameterPack() const {
return getAsType()->containsUnexpandedParameterPack();
}
- // Necessary to suppress a GCC warning.
- return false;
+ llvm_unreachable("Invalid NNS Kind!");
}
/// \brief Print this nested name specifier to the given output
@@ -382,8 +379,8 @@ SourceRange NestedNameSpecifierLoc::getLocalSourceRange() const {
LoadSourceLocation(Data, Offset + sizeof(void*)));
}
}
-
- return SourceRange();
+
+ llvm_unreachable("Invalid NNS Kind!");
}
TypeLoc NestedNameSpecifierLoc::getTypeLoc() const {
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp
index e7b87e4db67..8b2e35376bd 100644
--- a/clang/lib/AST/Stmt.cpp
+++ b/clang/lib/AST/Stmt.cpp
@@ -164,7 +164,6 @@ Stmt::child_range Stmt::children() {
#include "clang/AST/StmtNodes.inc"
}
llvm_unreachable("unknown statement kind!");
- return child_range();
}
SourceRange Stmt::getSourceRange() const {
@@ -177,7 +176,6 @@ SourceRange Stmt::getSourceRange() const {
#include "clang/AST/StmtNodes.inc"
}
llvm_unreachable("unknown statement kind!");
- return SourceRange();
}
void CompoundStmt::setStmts(ASTContext &C, Stmt **Stmts, unsigned NumStmts) {
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp
index 5a6b771b9a8..2fb67d93a66 100644
--- a/clang/lib/AST/StmtProfile.cpp
+++ b/clang/lib/AST/StmtProfile.cpp
@@ -503,7 +503,6 @@ static Stmt::StmtClass DecodeOperatorCall(const CXXOperatorCallExpr *S,
case OO_Conditional:
case NUM_OVERLOADED_OPERATORS:
llvm_unreachable("Invalid operator call kind");
- return Stmt::ArraySubscriptExprClass;
case OO_Plus:
if (S->getNumArgs() == 1) {
diff --git a/clang/lib/AST/TemplateBase.cpp b/clang/lib/AST/TemplateBase.cpp
index 0c011a8ef09..57df8a4dcec 100644
--- a/clang/lib/AST/TemplateBase.cpp
+++ b/clang/lib/AST/TemplateBase.cpp
@@ -100,7 +100,7 @@ bool TemplateArgument::isDependent() const {
return false;
}
- return false;
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
bool TemplateArgument::isInstantiationDependent() const {
@@ -137,8 +137,8 @@ bool TemplateArgument::isInstantiationDependent() const {
return false;
}
-
- return false;
+
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
bool TemplateArgument::isPackExpansion() const {
@@ -159,8 +159,8 @@ bool TemplateArgument::isPackExpansion() const {
case Expression:
return isa<PackExpansionExpr>(getAsExpr());
}
-
- return false;
+
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
bool TemplateArgument::containsUnexpandedParameterPack() const {
@@ -278,8 +278,7 @@ bool TemplateArgument::structurallyEquals(const TemplateArgument &Other) const {
return true;
}
- // Suppress warnings.
- return false;
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
TemplateArgument TemplateArgument::getPackExpansionPattern() const {
@@ -302,8 +301,8 @@ TemplateArgument TemplateArgument::getPackExpansionPattern() const {
case Template:
return TemplateArgument();
}
-
- return TemplateArgument();
+
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
void TemplateArgument::print(const PrintingPolicy &Policy,
@@ -412,8 +411,7 @@ SourceRange TemplateArgumentLoc::getSourceRange() const {
return SourceRange();
}
- // Silence bonus gcc warning.
- return SourceRange();
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
TemplateArgumentLoc
@@ -474,8 +472,8 @@ TemplateArgumentLoc::getPackExpansionPattern(SourceLocation &Ellipsis,
case TemplateArgument::Null:
return TemplateArgumentLoc();
}
-
- return TemplateArgumentLoc();
+
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
const DiagnosticBuilder &clang::operator<<(const DiagnosticBuilder &DB,
@@ -525,8 +523,8 @@ const DiagnosticBuilder &clang::operator<<(const DiagnosticBuilder &DB,
return DB << OS.str();
}
}
-
- return DB;
+
+ llvm_unreachable("Invalid TemplateArgument Kind!");
}
const ASTTemplateArgumentListInfo *
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 7fd83b54e40..7b30c500c6e 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -1364,7 +1364,6 @@ TypeWithKeyword::getTagTypeKindForTypeSpec(unsigned TypeSpec) {
}
llvm_unreachable("Type specifier is not a tag type kind.");
- return TTK_Union;
}
ElaboratedTypeKeyword
@@ -1419,7 +1418,6 @@ TypeWithKeyword::getKeywordName(ElaboratedTypeKeyword Keyword) {
}
llvm_unreachable("Unknown elaborated type keyword.");
- return "";
}
DependentTemplateSpecializationType::DependentTemplateSpecializationType(
@@ -1479,7 +1477,6 @@ const char *Type::getTypeClassName() const {
}
llvm_unreachable("Invalid type class.");
- return 0;
}
const char *BuiltinType::getName(const PrintingPolicy &Policy) const {
@@ -1521,7 +1518,6 @@ const char *BuiltinType::getName(const PrintingPolicy &Policy) const {
}
llvm_unreachable("Invalid builtin type.");
- return 0;
}
QualType QualType::getNonLValueExprType(ASTContext &Context) const {
@@ -1544,7 +1540,6 @@ StringRef FunctionType::getNameForCallConv(CallingConv CC) {
switch (CC) {
case CC_Default:
llvm_unreachable("no name for default cc");
- return "";
case CC_C: return "cdecl";
case CC_X86StdCall: return "stdcall";
@@ -1556,7 +1551,6 @@ StringRef FunctionType::getNameForCallConv(CallingConv CC) {
}
llvm_unreachable("Invalid calling convention.");
- return "";
}
FunctionProtoType::FunctionProtoType(QualType result, const QualType *args,
diff --git a/clang/lib/AST/TypeLoc.cpp b/clang/lib/AST/TypeLoc.cpp
index 97b0b501aa8..ed7faa9429c 100644
--- a/clang/lib/AST/TypeLoc.cpp
+++ b/clang/lib/AST/TypeLoc.cpp
@@ -196,57 +196,54 @@ SourceRange TypeOfExprTypeLoc::getLocalSourceRange() const {
TypeSpecifierType BuiltinTypeLoc::getWrittenTypeSpec() const {
if (needsExtraLocalData())
return static_cast<TypeSpecifierType>(getWrittenBuiltinSpecs().Type);
- else {
- switch (getTypePtr()->getKind()) {
- case BuiltinType::Void:
- return TST_void;
- case BuiltinType::Bool:
- return TST_bool;
- case BuiltinType::Char_U:
- case BuiltinType::Char_S:
- return TST_char;
- case BuiltinType::Char16:
- return TST_char16;
- case BuiltinType::Char32:
- return TST_char32;
- case BuiltinType::WChar_S:
- case BuiltinType::WChar_U:
- return TST_wchar;
-
- case BuiltinType::UChar:
- case BuiltinType::UShort:
- case BuiltinType::UInt:
- case BuiltinType::ULong:
- case BuiltinType::ULongLong:
- case BuiltinType::UInt128:
- case BuiltinType::SChar:
- case BuiltinType::Short:
- case BuiltinType::Int:
- case BuiltinType::Long:
- case BuiltinType::LongLong:
- case BuiltinType::Int128:
- case BuiltinType::Half:
- case BuiltinType::Float:
- case BuiltinType::Double:
- case BuiltinType::LongDouble:
- llvm_unreachable("Builtin type needs extra local data!");
- // Fall through, if the impossible happens.
-
- case BuiltinType::NullPtr:
- case BuiltinType::Overload:
- case BuiltinType::Dependent:
- case BuiltinType::BoundMember:
- case BuiltinType::UnknownAny:
- case BuiltinType::ARCUnbridgedCast:
- case BuiltinType::PseudoObject:
- case BuiltinType::ObjCId:
- case BuiltinType::ObjCClass:
- case BuiltinType::ObjCSel:
- return TST_unspecified;
- }
+ switch (getTypePtr()->getKind()) {
+ case BuiltinType::Void:
+ return TST_void;
+ case BuiltinType::Bool:
+ return TST_bool;
+ case BuiltinType::Char_U:
+ case BuiltinType::Char_S:
+ return TST_char;
+ case BuiltinType::Char16:
+ return TST_char16;
+ case BuiltinType::Char32:
+ return TST_char32;
+ case BuiltinType::WChar_S:
+ case BuiltinType::WChar_U:
+ return TST_wchar;
+ case BuiltinType::UChar:
+ case BuiltinType::UShort:
+ case BuiltinType::UInt:
+ case BuiltinType::ULong:
+ case BuiltinType::ULongLong:
+ case BuiltinType::UInt128:
+ case BuiltinType::SChar:
+ case BuiltinType::Short:
+ case BuiltinType::Int:
+ case BuiltinType::Long:
+ case BuiltinType::LongLong:
+ case BuiltinType::Int128:
+ case BuiltinType::Half:
+ case BuiltinType::Float:
+ case BuiltinType::Double:
+ case BuiltinType::LongDouble:
+ llvm_unreachable("Builtin type needs extra local data!");
+ // Fall through, if the impossible happens.
+
+ case BuiltinType::NullPtr:
+ case BuiltinType::Overload:
+ case BuiltinType::Dependent:
+ case BuiltinType::BoundMember:
+ case BuiltinType::UnknownAny:
+ case BuiltinType::ARCUnbridgedCast:
+ case BuiltinType::PseudoObject:
+ case BuiltinType::ObjCId:
+ case BuiltinType::ObjCClass:
+ case BuiltinType::ObjCSel:
+ return TST_unspecified;
}
-
- return TST_unspecified;
+
+ llvm_unreachable("Invalid BuiltinType Kind!");
}
TypeLoc TypeLoc::IgnoreParensImpl(TypeLoc TL) {
diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp
index 5dd42721d31..b6d71108bd5 100644
--- a/clang/lib/AST/TypePrinter.cpp
+++ b/clang/lib/AST/TypePrinter.cpp
@@ -934,7 +934,7 @@ void TypePrinter::printAttributed(const AttributedType *T,
case AttributedType::attr_objc_ownership:
S += "objc_ownership(";
switch (T->getEquivalentType().getObjCLifetime()) {
- case Qualifiers::OCL_None: llvm_unreachable("no ownership!"); break;
+ case Qualifiers::OCL_None: llvm_unreachable("no ownership!");
case Qualifiers::OCL_ExplicitNone: S += "none"; break;
case Qualifiers::OCL_Strong: S += "strong"; break;
case Qualifiers::OCL_Weak: S += "weak"; break;
OpenPOWER on IntegriCloud