зеркало из https://github.com/microsoft/clang.git
Removing a bunch of dead returns/breaks after llvm_unreachables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140407 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
c193dd8441
Коммит
eb2d1f1c88
|
@ -68,7 +68,6 @@ protected:
|
|||
|
||||
void* operator new(size_t bytes) throw() {
|
||||
llvm_unreachable("Attrs cannot be allocated with regular 'new'.");
|
||||
return 0;
|
||||
}
|
||||
void operator delete(void* data) throw() {
|
||||
llvm_unreachable("Attrs cannot be released with regular 'delete'.");
|
||||
|
|
|
@ -108,7 +108,6 @@ public:
|
|||
protected:
|
||||
void* operator new(size_t bytes) throw() {
|
||||
llvm_unreachable("Stmts cannot be allocated with regular 'new'.");
|
||||
return 0;
|
||||
}
|
||||
void operator delete(void* data) throw() {
|
||||
llvm_unreachable("Stmts cannot be released with regular 'delete'.");
|
||||
|
|
|
@ -3219,7 +3219,6 @@ ASTContext::getCanonicalTemplateArgument(const TemplateArgument &Arg) const {
|
|||
|
||||
// Silence GCC warning
|
||||
llvm_unreachable("Unhandled template argument kind");
|
||||
return TemplateArgument();
|
||||
}
|
||||
|
||||
NestedNameSpecifier *
|
||||
|
@ -4919,7 +4918,6 @@ CanQualType ASTContext::getFromTargetType(unsigned Type) const {
|
|||
}
|
||||
|
||||
llvm_unreachable("Unhandled TargetInfo::IntType value");
|
||||
return CanQualType();
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -5749,13 +5747,11 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS,
|
|||
#define DEPENDENT_TYPE(Class, Base) case Type::Class:
|
||||
#include "clang/AST/TypeNodes.def"
|
||||
llvm_unreachable("Non-canonical and dependent types shouldn't get here");
|
||||
return QualType();
|
||||
|
||||
case Type::LValueReference:
|
||||
case Type::RValueReference:
|
||||
case Type::MemberPointer:
|
||||
llvm_unreachable("C++ should never be in mergeTypes");
|
||||
return QualType();
|
||||
|
||||
case Type::ObjCInterface:
|
||||
case Type::IncompleteArray:
|
||||
|
@ -5763,7 +5759,6 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS,
|
|||
case Type::FunctionProto:
|
||||
case Type::ExtVector:
|
||||
llvm_unreachable("Types are eliminated above");
|
||||
return QualType();
|
||||
|
||||
case Type::Pointer:
|
||||
{
|
||||
|
@ -6015,7 +6010,6 @@ QualType ASTContext::getCorrespondingUnsignedType(QualType T) {
|
|||
return UnsignedInt128Ty;
|
||||
default:
|
||||
llvm_unreachable("Unexpected signed integer type");
|
||||
return QualType();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6476,7 +6470,6 @@ MangleContext *ASTContext::createMangleContext() {
|
|||
return createMicrosoftMangleContext(*this, getDiagnostics());
|
||||
}
|
||||
llvm_unreachable("Unsupported ABI");
|
||||
return 0;
|
||||
}
|
||||
|
||||
CXXABI::~CXXABI() {}
|
||||
|
|
|
@ -1891,7 +1891,6 @@ FunctionDecl::TemplatedKind FunctionDecl::getTemplatedKind() const {
|
|||
return TK_DependentFunctionTemplateSpecialization;
|
||||
|
||||
llvm_unreachable("Did we miss a TemplateOrSpecialization type?");
|
||||
return TK_NonTemplate;
|
||||
}
|
||||
|
||||
FunctionDecl *FunctionDecl::getInstantiatedFromMemberFunction() const {
|
||||
|
|
|
@ -572,7 +572,6 @@ Decl *Decl::castFromDeclContext (const DeclContext *D) {
|
|||
return static_cast<NAME##Decl*>(const_cast<DeclContext*>(D));
|
||||
#include "clang/AST/DeclNodes.inc"
|
||||
llvm_unreachable("a decl that inherits DeclContext isn't handled");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -592,7 +591,6 @@ DeclContext *Decl::castToDeclContext(const Decl *D) {
|
|||
return static_cast<NAME##Decl*>(const_cast<Decl*>(D));
|
||||
#include "clang/AST/DeclNodes.inc"
|
||||
llvm_unreachable("a decl that inherits DeclContext isn't handled");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1694,7 +1694,6 @@ static const char *getAccessName(AccessSpecifier AS) {
|
|||
default:
|
||||
case AS_none:
|
||||
llvm_unreachable("Invalid access specifier!");
|
||||
return 0;
|
||||
case AS_public:
|
||||
return "public";
|
||||
case AS_private:
|
||||
|
|
|
@ -550,7 +550,6 @@ ObjCInterfaceDecl *ObjCMethodDecl::getClassInterface() {
|
|||
|
||||
assert(!isa<ObjCProtocolDecl>(getDeclContext()) && "It's a protocol method");
|
||||
llvm_unreachable("unknown method context");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -782,7 +781,6 @@ const ObjCInterfaceDecl *ObjCIvarDecl::getContainingInterface() const {
|
|||
case ObjCCategoryImpl:
|
||||
case ObjCProtocol:
|
||||
llvm_unreachable("invalid ivar container!");
|
||||
return 0;
|
||||
|
||||
// Ivars can only appear in class extension categories.
|
||||
case ObjCCategory: {
|
||||
|
|
|
@ -192,7 +192,7 @@ void DeclPrinter::ProcessDeclGroup(SmallVectorImpl<Decl*>& Decls) {
|
|||
|
||||
void DeclPrinter::Print(AccessSpecifier AS) {
|
||||
switch(AS) {
|
||||
case AS_none: llvm_unreachable("No access specifier!"); break;
|
||||
case AS_none: llvm_unreachable("No access specifier!");
|
||||
case AS_public: Out << "public"; break;
|
||||
case AS_protected: Out << "protected"; break;
|
||||
case AS_private: Out << "private"; break;
|
||||
|
|
|
@ -194,7 +194,6 @@ DeclarationName::NameKind DeclarationName::getNameKind() const {
|
|||
|
||||
// Can't actually get here.
|
||||
llvm_unreachable("This should be unreachable!");
|
||||
return Identifier;
|
||||
}
|
||||
|
||||
bool DeclarationName::isDependentName() const {
|
||||
|
@ -340,7 +339,6 @@ void *DeclarationName::getFETokenInfoAsVoid() const {
|
|||
default:
|
||||
llvm_unreachable("Declaration name has no FETokenInfo");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DeclarationName::setFETokenInfo(void *T) {
|
||||
|
@ -622,5 +620,4 @@ SourceLocation DeclarationNameInfo::getEndLoc() const {
|
|||
return NameLoc;
|
||||
}
|
||||
llvm_unreachable("Unexpected declaration name kind");
|
||||
return SourceLocation();
|
||||
}
|
||||
|
|
|
@ -2503,8 +2503,6 @@ Expr::isNullPointerConstant(ASTContext &Ctx,
|
|||
switch (NPC) {
|
||||
case NPC_NeverValueDependent:
|
||||
llvm_unreachable("Unexpected value dependent expression!");
|
||||
// If the unthinkable happens, fall through to the safest alternative.
|
||||
|
||||
case NPC_ValueDependentIsNull:
|
||||
if (isTypeDependent() || getType()->isIntegralType(Ctx))
|
||||
return NPCK_ZeroInteger;
|
||||
|
|
|
@ -389,7 +389,6 @@ public:
|
|||
|
||||
RetTy VisitStmt(const Stmt *) {
|
||||
llvm_unreachable("Expression evaluator should not be called on stmts");
|
||||
return DerivedError(0);
|
||||
}
|
||||
RetTy VisitExpr(const Expr *E) {
|
||||
return DerivedError(E);
|
||||
|
|
|
@ -1070,7 +1070,6 @@ void CXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND,
|
|||
case DeclarationName::ObjCOneArgSelector:
|
||||
case DeclarationName::ObjCMultiArgSelector:
|
||||
llvm_unreachable("Can't mangle Objective-C selector names here!");
|
||||
break;
|
||||
|
||||
case DeclarationName::CXXConstructorName:
|
||||
if (ND == Structor)
|
||||
|
@ -1125,7 +1124,6 @@ void CXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND,
|
|||
|
||||
case DeclarationName::CXXUsingDirective:
|
||||
llvm_unreachable("Can't mangle a using directive name!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1513,7 +1511,6 @@ CXXNameMangler::mangleOperatorName(OverloadedOperatorKind OO, unsigned Arity) {
|
|||
case OO_None:
|
||||
case NUM_OVERLOADED_OPERATORS:
|
||||
llvm_unreachable("Not an overloaded operator");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -333,15 +333,12 @@ MicrosoftCXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND,
|
|||
case DeclarationName::ObjCOneArgSelector:
|
||||
case DeclarationName::ObjCMultiArgSelector:
|
||||
llvm_unreachable("Can't mangle Objective-C selector names here!");
|
||||
break;
|
||||
|
||||
case DeclarationName::CXXConstructorName:
|
||||
llvm_unreachable("Can't mangle constructors yet!");
|
||||
break;
|
||||
|
||||
case DeclarationName::CXXDestructorName:
|
||||
llvm_unreachable("Can't mangle destructors yet!");
|
||||
break;
|
||||
|
||||
case DeclarationName::CXXConversionFunctionName:
|
||||
// <operator-name> ::= ?B # (cast)
|
||||
|
@ -356,11 +353,9 @@ MicrosoftCXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND,
|
|||
case DeclarationName::CXXLiteralOperatorName:
|
||||
// FIXME: Was this added in VS2010? Does MS even know how to mangle this?
|
||||
llvm_unreachable("Don't know how to mangle literal operators yet!");
|
||||
break;
|
||||
|
||||
case DeclarationName::CXXUsingDirective:
|
||||
llvm_unreachable("Can't mangle a using directive name!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -514,12 +509,10 @@ void MicrosoftCXXNameMangler::mangleOperatorName(OverloadedOperatorKind OO) {
|
|||
|
||||
case OO_Conditional:
|
||||
llvm_unreachable("Don't know how to mangle ?:");
|
||||
break;
|
||||
|
||||
case OO_None:
|
||||
case NUM_OVERLOADED_OPERATORS:
|
||||
llvm_unreachable("Not an overloaded operator");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -714,7 +707,6 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T) {
|
|||
case BuiltinType::BoundMember:
|
||||
llvm_unreachable(
|
||||
"Overloaded and dependent types shouldn't get to name mangling");
|
||||
break;
|
||||
case BuiltinType::ObjCId: Out << "PAUobjc_object@@"; break;
|
||||
case BuiltinType::ObjCClass: Out << "PAUobjc_class@@"; break;
|
||||
case BuiltinType::ObjCSel: Out << "PAUobjc_selector@@"; break;
|
||||
|
@ -723,7 +715,6 @@ void MicrosoftCXXNameMangler::mangleType(const BuiltinType *T) {
|
|||
case BuiltinType::Char32:
|
||||
case BuiltinType::NullPtr:
|
||||
llvm_unreachable("Don't know how to mangle this type");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,6 @@ bool TemplateArgument::isDependent() const {
|
|||
switch (getKind()) {
|
||||
case Null:
|
||||
llvm_unreachable("Should not have a NULL template argument");
|
||||
return false;
|
||||
|
||||
case Type:
|
||||
return getAsType()->isDependentType();
|
||||
|
@ -108,7 +107,6 @@ bool TemplateArgument::isInstantiationDependent() const {
|
|||
switch (getKind()) {
|
||||
case Null:
|
||||
llvm_unreachable("Should not have a NULL template argument");
|
||||
return false;
|
||||
|
||||
case Type:
|
||||
return getAsType()->isInstantiationDependentType();
|
||||
|
|
|
@ -210,7 +210,6 @@ bool ArgTypeResult::matchesType(ASTContext &C, QualType argTy) const {
|
|||
switch (K) {
|
||||
case InvalidTy:
|
||||
llvm_unreachable("ArgTypeResult must be valid");
|
||||
return true;
|
||||
|
||||
case UnknownTy:
|
||||
return true;
|
||||
|
@ -313,7 +312,6 @@ QualType ArgTypeResult::getRepresentativeType(ASTContext &C) const {
|
|||
switch (K) {
|
||||
case InvalidTy:
|
||||
llvm_unreachable("No representative type for Invalid ArgTypeResult");
|
||||
// Fall-through.
|
||||
case UnknownTy:
|
||||
return QualType();
|
||||
case SpecificTy:
|
||||
|
|
|
@ -1864,7 +1864,6 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
|
|||
}
|
||||
|
||||
llvm_unreachable("Unhandled ABIArgInfo::Kind");
|
||||
return RValue::get(0);
|
||||
}
|
||||
|
||||
/* VarArg handling */
|
||||
|
|
|
@ -291,16 +291,12 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT) {
|
|||
switch (BT->getKind()) {
|
||||
case BuiltinType::Dependent:
|
||||
llvm_unreachable("Unexpected builtin type Dependent");
|
||||
return llvm::DIType();
|
||||
case BuiltinType::Overload:
|
||||
llvm_unreachable("Unexpected builtin type Overload");
|
||||
return llvm::DIType();
|
||||
case BuiltinType::BoundMember:
|
||||
llvm_unreachable("Unexpected builtin type BoundMember");
|
||||
return llvm::DIType();
|
||||
case BuiltinType::UnknownAny:
|
||||
llvm_unreachable("Unexpected builtin type UnknownAny");
|
||||
return llvm::DIType();
|
||||
case BuiltinType::NullPtr:
|
||||
return DBuilder.
|
||||
createNullPtrType(BT->getName(CGM.getContext().getLangOptions()));
|
||||
|
|
|
@ -1795,7 +1795,6 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) {
|
|||
return EmitFunctionDeclLValue(*this, E, FD);
|
||||
|
||||
llvm_unreachable("Unhandled member declaration!");
|
||||
return LValue();
|
||||
}
|
||||
|
||||
LValue CodeGenFunction::EmitLValueForBitfield(llvm::Value *BaseValue,
|
||||
|
|
|
@ -320,7 +320,6 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) {
|
|||
case CK_UncheckedDerivedToBase: {
|
||||
llvm_unreachable("cannot perform hierarchy conversion in EmitAggExpr: "
|
||||
"should have been unpacked before we got here");
|
||||
break;
|
||||
}
|
||||
|
||||
case CK_GetObjCProperty: {
|
||||
|
|
|
@ -104,7 +104,6 @@ public:
|
|||
ComplexPairTy VisitStmt(Stmt *S) {
|
||||
S->dump(CGF.getContext().getSourceManager());
|
||||
llvm_unreachable("Stmt can't have complex result type!");
|
||||
return ComplexPairTy();
|
||||
}
|
||||
ComplexPairTy VisitExpr(Expr *S);
|
||||
ComplexPairTy VisitParenExpr(ParenExpr *PE) { return Visit(PE->getSubExpr());}
|
||||
|
|
|
@ -781,9 +781,6 @@ public:
|
|||
return 0;
|
||||
|
||||
llvm_unreachable("Unable to handle InitListExpr");
|
||||
// Get rid of control reaches end of void function warning.
|
||||
// Not reached.
|
||||
return 0;
|
||||
}
|
||||
|
||||
llvm::Constant *VisitCXXConstructExpr(CXXConstructExpr *E) {
|
||||
|
@ -967,7 +964,6 @@ llvm::Constant *CodeGenModule::EmitConstantExpr(const Expr *E,
|
|||
switch (Result.Val.getKind()) {
|
||||
case APValue::Uninitialized:
|
||||
llvm_unreachable("Constant expressions should be initialized.");
|
||||
return 0;
|
||||
case APValue::LValue: {
|
||||
llvm::Type *DestTy = getTypes().ConvertTypeForMem(DestType);
|
||||
llvm::Constant *Offset =
|
||||
|
|
|
@ -154,7 +154,6 @@ public:
|
|||
Value *VisitStmt(Stmt *S) {
|
||||
S->dump(CGF.getContext().getSourceManager());
|
||||
llvm_unreachable("Stmt can't have complex result type!");
|
||||
return 0;
|
||||
}
|
||||
Value *VisitExpr(Expr *S);
|
||||
|
||||
|
@ -1264,10 +1263,8 @@ EmitAddConsiderOverflowBehavior(const UnaryOperator *E,
|
|||
BinOp.Opcode = BO_Add;
|
||||
BinOp.E = E;
|
||||
return EmitOverflowCheckedBinOp(BinOp);
|
||||
break;
|
||||
}
|
||||
llvm_unreachable("Unknown SignedOverflowBehaviorTy");
|
||||
return 0;
|
||||
}
|
||||
|
||||
llvm::Value *
|
||||
|
@ -2756,7 +2753,6 @@ LValue CodeGenFunction::EmitCompoundAssignmentLValue(
|
|||
case BO_Assign:
|
||||
case BO_Comma:
|
||||
llvm_unreachable("Not valid compound assignment operators");
|
||||
break;
|
||||
}
|
||||
|
||||
llvm_unreachable("Unhandled compound assignment operator");
|
||||
|
|
|
@ -1061,7 +1061,6 @@ public:
|
|||
/// class of the given name.
|
||||
virtual llvm::GlobalVariable *GetClassGlobal(const std::string &Name) {
|
||||
llvm_unreachable("CGObjCMac::GetClassGlobal");
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -139,11 +139,9 @@ void CodeGenFunction::EmitStmt(const Stmt *S) {
|
|||
case Stmt::ObjCAtCatchStmtClass:
|
||||
llvm_unreachable(
|
||||
"@catch statements should be handled by EmitObjCAtTryStmt");
|
||||
break;
|
||||
case Stmt::ObjCAtFinallyStmtClass:
|
||||
llvm_unreachable(
|
||||
"@finally statements should be handled by EmitObjCAtTryStmt");
|
||||
break;
|
||||
case Stmt::ObjCAtThrowStmtClass:
|
||||
EmitObjCAtThrowStmt(cast<ObjCAtThrowStmt>(*S));
|
||||
break;
|
||||
|
|
|
@ -264,7 +264,6 @@ static BaseOffset ComputeBaseOffset(ASTContext &Context,
|
|||
if (!const_cast<CXXRecordDecl *>(DerivedRD)->
|
||||
isDerivedFrom(const_cast<CXXRecordDecl *>(BaseRD), Paths)) {
|
||||
llvm_unreachable("Class must be derived from the passed in base class!");
|
||||
return BaseOffset();
|
||||
}
|
||||
|
||||
return ComputeBaseOffset(Context, DerivedRD, Paths.front());
|
||||
|
@ -701,7 +700,6 @@ CharUnits VCallOffsetMap::getVCallOffsetOffset(const CXXMethodDecl *MD) {
|
|||
}
|
||||
|
||||
llvm_unreachable("Should always find a vcall offset offset!");
|
||||
return CharUnits::Zero();
|
||||
}
|
||||
|
||||
/// VCallAndVBaseOffsetBuilder - Class for building vcall and vbase offsets.
|
||||
|
@ -1362,7 +1360,6 @@ VTableBuilder::ComputeThisAdjustmentBaseOffset(BaseSubobject Base,
|
|||
if (!const_cast<CXXRecordDecl *>(DerivedRD)->
|
||||
isDerivedFrom(const_cast<CXXRecordDecl *>(BaseRD), Paths)) {
|
||||
llvm_unreachable("Class must be derived from the passed in base class!");
|
||||
return BaseOffset();
|
||||
}
|
||||
|
||||
// We have to go through all the paths, and see which one leads us to the
|
||||
|
|
|
@ -276,7 +276,6 @@ static raw_ostream *GetOutputStream(CompilerInstance &CI,
|
|||
}
|
||||
|
||||
llvm_unreachable("Invalid action!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
ASTConsumer *CodeGenAction::CreateASTConsumer(CompilerInstance &CI,
|
||||
|
|
|
@ -274,7 +274,6 @@ static llvm::Type *getTypeForFormat(llvm::LLVMContext &VMContext,
|
|||
if (&format == &llvm::APFloat::x87DoubleExtended)
|
||||
return llvm::Type::getX86_FP80Ty(VMContext);
|
||||
llvm_unreachable("Unknown float format!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// ConvertType - Convert the specified type to its LLVM form.
|
||||
|
|
|
@ -1893,7 +1893,6 @@ ABIArgInfo X86_64ABIInfo::classifyArgumentType(QualType Ty, unsigned &neededInt,
|
|||
case X87:
|
||||
case ComplexX87:
|
||||
llvm_unreachable("Invalid classification for hi word.");
|
||||
break;
|
||||
|
||||
case NoClass: break;
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@ const char *Action::getClassName(ActionClass AC) {
|
|||
}
|
||||
|
||||
llvm_unreachable("invalid class");
|
||||
return 0;
|
||||
}
|
||||
|
||||
InputAction::InputAction(const Arg &_Input, types::ID _Type)
|
||||
|
|
|
@ -1114,7 +1114,6 @@ Action *Driver::ConstructPhaseAction(const ArgList &Args, phases::ID Phase,
|
|||
}
|
||||
|
||||
llvm_unreachable("invalid phase in ConstructPhaseAction");
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Driver::IsUsingLTO(const ArgList &Args) const {
|
||||
|
|
|
@ -116,7 +116,6 @@ OptionGroup::OptionGroup(OptSpecifier ID, const char *Name,
|
|||
|
||||
Arg *OptionGroup::accept(const ArgList &Args, unsigned &Index) const {
|
||||
llvm_unreachable("accept() should never be called on an OptionGroup");
|
||||
return 0;
|
||||
}
|
||||
|
||||
InputOption::InputOption(OptSpecifier ID)
|
||||
|
@ -125,7 +124,6 @@ InputOption::InputOption(OptSpecifier ID)
|
|||
|
||||
Arg *InputOption::accept(const ArgList &Args, unsigned &Index) const {
|
||||
llvm_unreachable("accept() should never be called on an InputOption");
|
||||
return 0;
|
||||
}
|
||||
|
||||
UnknownOption::UnknownOption(OptSpecifier ID)
|
||||
|
@ -134,7 +132,6 @@ UnknownOption::UnknownOption(OptSpecifier ID)
|
|||
|
||||
Arg *UnknownOption::accept(const ArgList &Args, unsigned &Index) const {
|
||||
llvm_unreachable("accept() should never be called on an UnknownOption");
|
||||
return 0;
|
||||
}
|
||||
|
||||
FlagOption::FlagOption(OptSpecifier ID, const char *Name,
|
||||
|
|
|
@ -24,5 +24,4 @@ const char *phases::getPhaseName(ID Id) {
|
|||
}
|
||||
|
||||
llvm_unreachable("Invalid phase id.");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -61,7 +61,6 @@ SourceRange ASTLocation::getSourceRange() const {
|
|||
|
||||
switch (getKind()) {
|
||||
default: llvm_unreachable("Invalid Kind");
|
||||
return SourceRange();
|
||||
case N_Decl:
|
||||
return D->getSourceRange();
|
||||
case N_Stmt:
|
||||
|
|
|
@ -30,7 +30,6 @@ static int SelectDigraphErrorMessage(tok::TokenKind Kind) {
|
|||
case tok::kw_static_cast: return 4;
|
||||
default:
|
||||
llvm_unreachable("Unknown type for digraph error message.");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -784,7 +783,7 @@ ExprResult Parser::ParseCXXCasts() {
|
|||
const char *CastName = 0; // For error messages
|
||||
|
||||
switch (Kind) {
|
||||
default: llvm_unreachable("Unknown C++ cast!"); abort();
|
||||
default: llvm_unreachable("Unknown C++ cast!");
|
||||
case tok::kw_const_cast: CastName = "const_cast"; break;
|
||||
case tok::kw_dynamic_cast: CastName = "dynamic_cast"; break;
|
||||
case tok::kw_reinterpret_cast: CastName = "reinterpret_cast"; break;
|
||||
|
@ -1292,7 +1291,6 @@ void Parser::ParseCXXSimpleTypeSpecifier(DeclSpec &DS) {
|
|||
llvm_unreachable("Annotation token should already be formed!");
|
||||
default:
|
||||
llvm_unreachable("Not a simple-type-specifier token!");
|
||||
abort();
|
||||
|
||||
// type-name
|
||||
case tok::annot_typename: {
|
||||
|
|
|
@ -138,7 +138,6 @@ DeclContext *Sema::computeDeclContext(const CXXScopeSpec &SS,
|
|||
switch (NNS->getKind()) {
|
||||
case NestedNameSpecifier::Identifier:
|
||||
llvm_unreachable("Dependent nested-name-specifier has no DeclContext");
|
||||
break;
|
||||
|
||||
case NestedNameSpecifier::Namespace:
|
||||
return NNS->getAsNamespace();
|
||||
|
|
|
@ -3401,7 +3401,6 @@ void Sema::CodeCompleteTag(Scope *S, unsigned TagSpec) {
|
|||
|
||||
default:
|
||||
llvm_unreachable("Unknown type specifier kind in CodeCompleteTag");
|
||||
return;
|
||||
}
|
||||
|
||||
ResultBuilder Results(*this, CodeCompleter->getAllocator(), ContextKind);
|
||||
|
|
|
@ -2938,7 +2938,6 @@ Sema::GetNameFromUnqualifiedId(const UnqualifiedId &Name) {
|
|||
} // switch (Name.getKind())
|
||||
|
||||
llvm_unreachable("Unknown name kind");
|
||||
return DeclarationNameInfo();
|
||||
}
|
||||
|
||||
static QualType getCoreType(QualType Ty) {
|
||||
|
@ -8375,7 +8374,6 @@ void Sema::DiagnoseNontrivial(const RecordType* T, CXXSpecialMember member) {
|
|||
}
|
||||
|
||||
llvm_unreachable("found no user-declared constructors");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -8460,7 +8458,7 @@ void Sema::DiagnoseNontrivial(const RecordType* T, CXXSpecialMember member) {
|
|||
case CXXDestructor:
|
||||
hasTrivial = &CXXRecordDecl::hasTrivialDestructor; break;
|
||||
default:
|
||||
llvm_unreachable("unexpected special member"); return;
|
||||
llvm_unreachable("unexpected special member");
|
||||
}
|
||||
|
||||
// Check for nontrivial bases (and recurse).
|
||||
|
|
|
@ -3206,7 +3206,6 @@ static void handleNSReturnsRetainedAttr(Sema &S, Decl *D,
|
|||
switch (Attr.getKind()) {
|
||||
default:
|
||||
llvm_unreachable("invalid ownership attribute");
|
||||
return;
|
||||
case AttributeList::AT_ns_returns_autoreleased:
|
||||
D->addAttr(::new (S.Context) NSReturnsAutoreleasedAttr(Attr.getRange(),
|
||||
S.Context));
|
||||
|
|
|
@ -9978,7 +9978,6 @@ void Sema::SetDeclDefaulted(Decl *Dcl, SourceLocation DefaultLoc) {
|
|||
|
||||
case CXXInvalid:
|
||||
llvm_unreachable("Invalid special member.");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
Diag(DefaultLoc, diag::err_default_special_members);
|
||||
|
|
|
@ -8942,7 +8942,6 @@ ExprResult Sema::ActOnGNUNullExpr(SourceLocation TokenLoc) {
|
|||
Ty = Context.LongLongTy;
|
||||
else {
|
||||
llvm_unreachable("I don't know size of pointer!");
|
||||
Ty = Context.IntTy;
|
||||
}
|
||||
|
||||
return Owned(new (Context) GNUNullExpr(Ty, TokenLoc));
|
||||
|
|
|
@ -1526,7 +1526,6 @@ bool Sema::FindAllocationOverload(SourceLocation StartLoc, SourceRange Range,
|
|||
}
|
||||
}
|
||||
llvm_unreachable("Unreachable, bad result from BestViableFunction");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2182,7 +2181,6 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
|
|||
|
||||
case ImplicitConversionSequence::EllipsisConversion:
|
||||
llvm_unreachable("Cannot perform an ellipsis conversion");
|
||||
return Owned(From);
|
||||
|
||||
case ImplicitConversionSequence::BadConversion:
|
||||
return ExprError();
|
||||
|
@ -2285,7 +2283,6 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
|
|||
|
||||
default:
|
||||
llvm_unreachable("Improper first standard conversion");
|
||||
break;
|
||||
}
|
||||
|
||||
// Perform the second implicit conversion
|
||||
|
@ -2525,7 +2522,6 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
|
|||
case ICK_Qualification:
|
||||
case ICK_Num_Conversion_Kinds:
|
||||
llvm_unreachable("Improper second standard conversion");
|
||||
break;
|
||||
}
|
||||
|
||||
switch (SCS.Third) {
|
||||
|
@ -2551,7 +2547,6 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
|
|||
|
||||
default:
|
||||
llvm_unreachable("Improper third standard conversion");
|
||||
break;
|
||||
}
|
||||
|
||||
return Owned(From);
|
||||
|
@ -3561,7 +3556,6 @@ static bool FindConditionalOverload(Sema &Self, ExprResult &LHS, ExprResult &RHS
|
|||
|
||||
case OR_Deleted:
|
||||
llvm_unreachable("Conditional operator has only built-in overloads");
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -6334,7 +6334,6 @@ Sema::AddBuiltinOperatorCandidates(OverloadedOperatorKind Op,
|
|||
case OO_None:
|
||||
case NUM_OVERLOADED_OPERATORS:
|
||||
llvm_unreachable("Expected an overloaded operator");
|
||||
break;
|
||||
|
||||
case OO_New:
|
||||
case OO_Delete:
|
||||
|
@ -6343,7 +6342,6 @@ Sema::AddBuiltinOperatorCandidates(OverloadedOperatorKind Op,
|
|||
case OO_Call:
|
||||
llvm_unreachable(
|
||||
"Special operators don't use AddBuiltinOperatorCandidates");
|
||||
break;
|
||||
|
||||
case OO_Comma:
|
||||
case OO_Arrow:
|
||||
|
|
|
@ -1388,7 +1388,6 @@ Sema::BuildCXXForRangeStmt(SourceLocation ForLoc, SourceLocation ColonLoc,
|
|||
// Can't be a DependentSizedArrayType or an IncompleteArrayType since
|
||||
// UnqAT is not incomplete and Range is not type-dependent.
|
||||
llvm_unreachable("Unexpected array type in for-range");
|
||||
return StmtError();
|
||||
}
|
||||
|
||||
// end-expr is __range + __bound.
|
||||
|
|
|
@ -2683,7 +2683,6 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param,
|
|||
switch (Arg.getArgument().getKind()) {
|
||||
case TemplateArgument::Null:
|
||||
llvm_unreachable("Should never see a NULL template argument here");
|
||||
return true;
|
||||
|
||||
case TemplateArgument::Expression: {
|
||||
TemplateArgument Result;
|
||||
|
@ -2806,7 +2805,6 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param,
|
|||
switch (Arg.getArgument().getKind()) {
|
||||
case TemplateArgument::Null:
|
||||
llvm_unreachable("Should never see a NULL template argument here");
|
||||
return true;
|
||||
|
||||
case TemplateArgument::Template:
|
||||
case TemplateArgument::TemplateExpansion:
|
||||
|
@ -5218,7 +5216,6 @@ Sema::CheckSpecializationInstantiationRedecl(SourceLocation NewLoc,
|
|||
case TSK_Undeclared:
|
||||
case TSK_ImplicitInstantiation:
|
||||
llvm_unreachable("Don't check implicit instantiations here");
|
||||
return false;
|
||||
|
||||
case TSK_ExplicitSpecialization:
|
||||
switch (PrevTSK) {
|
||||
|
@ -5351,8 +5348,6 @@ Sema::CheckSpecializationInstantiationRedecl(SourceLocation NewLoc,
|
|||
}
|
||||
|
||||
llvm_unreachable("Missing specialization/instantiation case?");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// \brief Perform semantic analysis for the given dependent function
|
||||
|
|
|
@ -1540,7 +1540,6 @@ DeduceTemplateArguments(Sema &S,
|
|||
switch (Param.getKind()) {
|
||||
case TemplateArgument::Null:
|
||||
llvm_unreachable("Null template argument in parameter list");
|
||||
break;
|
||||
|
||||
case TemplateArgument::Type:
|
||||
if (Arg.getKind() == TemplateArgument::Type)
|
||||
|
@ -1831,7 +1830,6 @@ static bool isSameTemplateArg(ASTContext &Context,
|
|||
switch (X.getKind()) {
|
||||
case TemplateArgument::Null:
|
||||
llvm_unreachable("Comparing NULL template argument");
|
||||
break;
|
||||
|
||||
case TemplateArgument::Type:
|
||||
return Context.getCanonicalType(X.getAsType()) ==
|
||||
|
|
|
@ -97,7 +97,6 @@ void Sema::InstantiateAttrs(const MultiLevelTemplateArgumentList &TemplateArgs,
|
|||
Decl *
|
||||
TemplateDeclInstantiator::VisitTranslationUnitDecl(TranslationUnitDecl *D) {
|
||||
llvm_unreachable("Translation units cannot be instantiated");
|
||||
return D;
|
||||
}
|
||||
|
||||
Decl *
|
||||
|
@ -111,7 +110,6 @@ TemplateDeclInstantiator::VisitLabelDecl(LabelDecl *D) {
|
|||
Decl *
|
||||
TemplateDeclInstantiator::VisitNamespaceDecl(NamespaceDecl *D) {
|
||||
llvm_unreachable("Namespaces cannot be instantiated");
|
||||
return D;
|
||||
}
|
||||
|
||||
Decl *
|
||||
|
@ -702,7 +700,6 @@ Decl *TemplateDeclInstantiator::VisitEnumDecl(EnumDecl *D) {
|
|||
|
||||
Decl *TemplateDeclInstantiator::VisitEnumConstantDecl(EnumConstantDecl *D) {
|
||||
llvm_unreachable("EnumConstantDecls can only occur within EnumDecls.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Decl *TemplateDeclInstantiator::VisitClassTemplateDecl(ClassTemplateDecl *D) {
|
||||
|
|
|
@ -1760,7 +1760,7 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state,
|
|||
if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_static)
|
||||
break;
|
||||
switch (cast<TagDecl>(SemaRef.CurContext)->getTagKind()) {
|
||||
case TTK_Enum: llvm_unreachable("unhandled tag kind"); break;
|
||||
case TTK_Enum: llvm_unreachable("unhandled tag kind");
|
||||
case TTK_Struct: Error = 1; /* Struct member */ break;
|
||||
case TTK_Union: Error = 2; /* Union member */ break;
|
||||
case TTK_Class: Error = 3; /* Class member */ break;
|
||||
|
|
|
@ -1729,7 +1729,6 @@ public:
|
|||
|
||||
default:
|
||||
llvm_unreachable("Invalid C++ named cast");
|
||||
break;
|
||||
}
|
||||
|
||||
return ExprError();
|
||||
|
@ -2682,7 +2681,6 @@ TreeTransform<Derived>
|
|||
}
|
||||
|
||||
llvm_unreachable("Unknown name kind.");
|
||||
return DeclarationNameInfo();
|
||||
}
|
||||
|
||||
template<typename Derived>
|
||||
|
@ -8050,7 +8048,6 @@ template<typename Derived>
|
|||
ExprResult
|
||||
TreeTransform<Derived>::TransformAsTypeExpr(AsTypeExpr *E) {
|
||||
llvm_unreachable("Cannot transform asType expressions yet");
|
||||
return SemaRef.Owned(E);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
|
@ -4994,7 +4994,6 @@ ASTReader::ReadTemplateName(Module &F, const RecordData &Record,
|
|||
}
|
||||
|
||||
llvm_unreachable("Unhandled template name kind!");
|
||||
return TemplateName();
|
||||
}
|
||||
|
||||
TemplateArgument
|
||||
|
@ -5034,7 +5033,6 @@ ASTReader::ReadTemplateArgument(Module &F,
|
|||
}
|
||||
|
||||
llvm_unreachable("Unhandled template argument kind!");
|
||||
return TemplateArgument();
|
||||
}
|
||||
|
||||
TemplateParameterList *
|
||||
|
|
|
@ -346,7 +346,6 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) {
|
|||
FD->IdentifierNamespace = Record[Idx++];
|
||||
switch ((FunctionDecl::TemplatedKind)Record[Idx++]) {
|
||||
default: llvm_unreachable("Unhandled TemplatedKind!");
|
||||
break;
|
||||
case FunctionDecl::TK_NonTemplate:
|
||||
break;
|
||||
case FunctionDecl::TK_FunctionTemplate:
|
||||
|
@ -1481,7 +1480,6 @@ Decl *ASTReader::ReadDeclRecord(DeclID ID) {
|
|||
case DECL_CONTEXT_LEXICAL:
|
||||
case DECL_CONTEXT_VISIBLE:
|
||||
llvm_unreachable("Record cannot be de-serialized with ReadDeclRecord");
|
||||
break;
|
||||
case DECL_TYPEDEF:
|
||||
D = TypedefDecl::Create(Context, 0, SourceLocation(), SourceLocation(),
|
||||
0, 0);
|
||||
|
|
|
@ -296,7 +296,6 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) {
|
|||
Record.push_back(D->getTemplatedKind());
|
||||
switch (D->getTemplatedKind()) {
|
||||
default: llvm_unreachable("Unhandled TemplatedKind!");
|
||||
break;
|
||||
case FunctionDecl::TK_NonTemplate:
|
||||
break;
|
||||
case FunctionDecl::TK_FunctionTemplate:
|
||||
|
|
|
@ -1744,7 +1744,6 @@ FindReportInEquivalenceClass(BugReportEquivClass& EQ,
|
|||
if (errorNode->isSink()) {
|
||||
llvm_unreachable(
|
||||
"BugType::isSuppressSink() should not be 'true' for sink end nodes");
|
||||
return 0;
|
||||
}
|
||||
// No successors? By definition this nodes isn't post-dominated by a sink.
|
||||
if (errorNode->succ_empty()) {
|
||||
|
|
|
@ -327,7 +327,6 @@ void CoreEngine::HandleBlockExit(const CFGBlock * B, ExplodedNode *Pred) {
|
|||
switch (Term->getStmtClass()) {
|
||||
default:
|
||||
llvm_unreachable("Analysis for this terminator not implemented.");
|
||||
break;
|
||||
|
||||
case Stmt::BinaryOperatorClass: // '&&' and '||'
|
||||
HandleBranch(cast<BinaryOperator>(Term)->getLHS(), Term, B, Pred);
|
||||
|
|
|
@ -1031,7 +1031,6 @@ void ExprEngine::processIndirectGoto(IndirectGotoNodeBuilder &builder) {
|
|||
}
|
||||
|
||||
llvm_unreachable("No block with label.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (isa<loc::ConcreteInt>(V) || isa<UndefinedVal>(V)) {
|
||||
|
|
|
@ -626,7 +626,6 @@ void ExprEngine::VisitUnaryOperator(const UnaryOperator* U,
|
|||
switch (U->getOpcode()) {
|
||||
default:
|
||||
llvm_unreachable("Invalid Opcode.");
|
||||
break;
|
||||
|
||||
case UO_Not:
|
||||
// FIXME: Do we need to handle promotions?
|
||||
|
|
|
@ -892,7 +892,6 @@ SVal RegionStoreManager::Retrieve(Store store, Loc L, QualType T) {
|
|||
|
||||
if (isa<CodeTextRegion>(MR)) {
|
||||
llvm_unreachable("Why load from a code text region?");
|
||||
return UnknownVal();
|
||||
}
|
||||
|
||||
// FIXME: Perhaps this method should just take a 'const MemRegion*' argument
|
||||
|
|
|
@ -370,6 +370,5 @@ void Loc::dumpToStream(raw_ostream &os) const {
|
|||
}
|
||||
default:
|
||||
llvm_unreachable("Pretty-printing not implemented for this Loc.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -348,7 +348,6 @@ SVal SimpleSValBuilder::evalBinOpNN(const ProgramState *state,
|
|||
case BO_LAnd:
|
||||
case BO_LOr:
|
||||
llvm_unreachable("Logical operators handled by branching logic.");
|
||||
return UnknownVal();
|
||||
case BO_Assign:
|
||||
case BO_MulAssign:
|
||||
case BO_DivAssign:
|
||||
|
@ -362,11 +361,9 @@ SVal SimpleSValBuilder::evalBinOpNN(const ProgramState *state,
|
|||
case BO_OrAssign:
|
||||
case BO_Comma:
|
||||
llvm_unreachable("'=' and ',' operators handled by ExprEngine.");
|
||||
return UnknownVal();
|
||||
case BO_PtrMemD:
|
||||
case BO_PtrMemI:
|
||||
llvm_unreachable("Pointer arithmetic not handled here.");
|
||||
return UnknownVal();
|
||||
case BO_LT:
|
||||
case BO_GT:
|
||||
case BO_LE:
|
||||
|
@ -557,7 +554,6 @@ SVal SimpleSValBuilder::evalBinOpLL(const ProgramState *state,
|
|||
switch (op) {
|
||||
default:
|
||||
llvm_unreachable("Unimplemented operation for two identical values");
|
||||
return UnknownVal();
|
||||
case BO_Sub:
|
||||
return makeZeroVal(resultTy);
|
||||
case BO_EQ:
|
||||
|
@ -574,7 +570,6 @@ SVal SimpleSValBuilder::evalBinOpLL(const ProgramState *state,
|
|||
switch (lhs.getSubKind()) {
|
||||
default:
|
||||
llvm_unreachable("Ordering not implemented for this Loc.");
|
||||
return UnknownVal();
|
||||
|
||||
case loc::GotoLabelKind:
|
||||
// The only thing we know about labels is that they're non-null.
|
||||
|
|
|
@ -104,7 +104,6 @@ const MemRegion *StoreManager::castRegion(const MemRegion *R, QualType CastToTy)
|
|||
case MemRegion::NonStaticGlobalSpaceRegionKind:
|
||||
case MemRegion::StaticGlobalSpaceRegionKind: {
|
||||
llvm_unreachable("Invalid region cast");
|
||||
break;
|
||||
}
|
||||
|
||||
case MemRegion::FunctionTextRegionKind:
|
||||
|
@ -204,7 +203,6 @@ const MemRegion *StoreManager::castRegion(const MemRegion *R, QualType CastToTy)
|
|||
}
|
||||
|
||||
llvm_unreachable("unreachable");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -262,7 +260,6 @@ SVal StoreManager::getLValueFieldOrIvar(const Decl *D, SVal Base) {
|
|||
|
||||
default:
|
||||
llvm_unreachable("Unhandled Base.");
|
||||
return Base;
|
||||
}
|
||||
|
||||
// NOTE: We must have this check first because ObjCIvarDecl is a subclass
|
||||
|
|
|
@ -29,7 +29,6 @@ static void print(raw_ostream &os, BinaryOperator::Opcode Op) {
|
|||
switch (Op) {
|
||||
default:
|
||||
llvm_unreachable("operator printing not implemented");
|
||||
break;
|
||||
case BO_Mul: os << '*' ; break;
|
||||
case BO_Div: os << '/' ; break;
|
||||
case BO_Rem: os << '%' ; break;
|
||||
|
|
|
@ -106,7 +106,7 @@ CXString clang_formatDiagnostic(CXDiagnostic Diagnostic, unsigned Options) {
|
|||
|
||||
/* Print warning/error/etc. */
|
||||
switch (Severity) {
|
||||
case CXDiagnostic_Ignored: llvm_unreachable("impossible"); break;
|
||||
case CXDiagnostic_Ignored: llvm_unreachable("impossible");
|
||||
case CXDiagnostic_Note: Out << "note: "; break;
|
||||
case CXDiagnostic_Warning: Out << "warning: "; break;
|
||||
case CXDiagnostic_Error: Out << "error: "; break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче