Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave

no extra safety anyway.

llvm-svn: 91207
This commit is contained in:
Jeffrey Yasskin
2009-12-12 05:05:38 +00:00
parent 7f1c9c2ff6
commit 1615d45daa
22 changed files with 44 additions and 44 deletions

View File

@@ -356,7 +356,7 @@ public:
assert(Kind == K_None); assert(Kind == K_None);
break; break;
case TemplateArgument::Null: case TemplateArgument::Null:
llvm::llvm_unreachable("source info for null template argument?"); llvm_unreachable("source info for null template argument?");
} }
} }
#endif #endif

View File

@@ -33,7 +33,7 @@ public:
case TypeLoc::CLASS: DISPATCH(CLASS##TypeLoc); case TypeLoc::CLASS: DISPATCH(CLASS##TypeLoc);
#include "clang/AST/TypeLocNodes.def" #include "clang/AST/TypeLocNodes.def"
} }
llvm::llvm_unreachable("unexpected type loc class!"); llvm_unreachable("unexpected type loc class!");
} }
RetTy Visit(UnqualTypeLoc TyLoc) { RetTy Visit(UnqualTypeLoc TyLoc) {

View File

@@ -1214,7 +1214,7 @@ TagDecl* TagDecl::getDefinition(ASTContext& C) const {
TagDecl::TagKind TagDecl::getTagKindForTypeSpec(unsigned TypeSpec) { TagDecl::TagKind TagDecl::getTagKindForTypeSpec(unsigned TypeSpec) {
switch (TypeSpec) { switch (TypeSpec) {
default: llvm::llvm_unreachable("unexpected type specifier"); default: llvm_unreachable("unexpected type specifier");
case DeclSpec::TST_struct: return TK_struct; case DeclSpec::TST_struct: return TK_struct;
case DeclSpec::TST_class: return TK_class; case DeclSpec::TST_class: return TK_class;
case DeclSpec::TST_union: return TK_union; case DeclSpec::TST_union: return TK_union;

View File

@@ -1813,7 +1813,7 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx,
} }
EvalResult EvalResult; EvalResult EvalResult;
if (!Evaluate(EvalResult, Ctx)) if (!Evaluate(EvalResult, Ctx))
llvm::llvm_unreachable("ICE cannot be evaluated!"); llvm_unreachable("ICE cannot be evaluated!");
assert(!EvalResult.HasSideEffects && "ICE with side effects!"); assert(!EvalResult.HasSideEffects && "ICE with side effects!");
assert(EvalResult.Val.isInt() && "ICE that isn't integer!"); assert(EvalResult.Val.isInt() && "ICE that isn't integer!");
Result = EvalResult.Val.getInt(); Result = EvalResult.Val.getInt();

View File

@@ -39,7 +39,7 @@ Stmt *AnalysisContext::getBody() {
else if (const BlockDecl *BD = dyn_cast<BlockDecl>(D)) else if (const BlockDecl *BD = dyn_cast<BlockDecl>(D))
return BD->getBody(); return BD->getBody();
llvm::llvm_unreachable("unknown code decl"); llvm_unreachable("unknown code decl");
} }
const ImplicitParamDecl *AnalysisContext::getSelfDecl() const { const ImplicitParamDecl *AnalysisContext::getSelfDecl() const {

View File

@@ -182,7 +182,7 @@ static void CopyObject(CodeGenFunction &CGF, const Expr *E,
Callee, CallArgs, CopyCtor); Callee, CallArgs, CopyCtor);
CGF.setInvokeDest(PrevLandingPad); CGF.setInvokeDest(PrevLandingPad);
} else } else
llvm::llvm_unreachable("uncopyable object"); llvm_unreachable("uncopyable object");
} }
} }
@@ -223,7 +223,7 @@ static void CopyObject(CodeGenFunction &CGF, QualType ObjectType,
CGF.EmitCall(CGF.CGM.getTypes().getFunctionInfo(ResultType, CallArgs), CGF.EmitCall(CGF.CGM.getTypes().getFunctionInfo(ResultType, CallArgs),
Callee, CallArgs, CopyCtor); Callee, CallArgs, CopyCtor);
} else } else
llvm::llvm_unreachable("uncopyable object"); llvm_unreachable("uncopyable object");
} }
} }

View File

@@ -891,7 +891,7 @@ GetLinkageForVariable(ASTContext &Context, const VarDecl *VD) {
return CodeGenModule::GVA_StrongExternal; return CodeGenModule::GVA_StrongExternal;
case TSK_ExplicitInstantiationDeclaration: case TSK_ExplicitInstantiationDeclaration:
llvm::llvm_unreachable("Variable should not be instantiated"); llvm_unreachable("Variable should not be instantiated");
// Fall through to treat this like any other instantiation. // Fall through to treat this like any other instantiation.
case TSK_ImplicitInstantiation: case TSK_ImplicitInstantiation:

View File

@@ -742,7 +742,7 @@ void CXXNameMangler::mangleType(QualType T) {
#define ABSTRACT_TYPE(CLASS, PARENT) #define ABSTRACT_TYPE(CLASS, PARENT)
#define NON_CANONICAL_TYPE(CLASS, PARENT) \ #define NON_CANONICAL_TYPE(CLASS, PARENT) \
case Type::CLASS: \ case Type::CLASS: \
llvm::llvm_unreachable("can't mangle non-canonical type " #CLASS "Type"); \ llvm_unreachable("can't mangle non-canonical type " #CLASS "Type"); \
return; return;
#define TYPE(CLASS, PARENT) \ #define TYPE(CLASS, PARENT) \
case Type::CLASS: \ case Type::CLASS: \
@@ -836,7 +836,7 @@ void CXXNameMangler::mangleType(const FunctionProtoType *T) {
Out << 'E'; Out << 'E';
} }
void CXXNameMangler::mangleType(const FunctionNoProtoType *T) { void CXXNameMangler::mangleType(const FunctionNoProtoType *T) {
llvm::llvm_unreachable("Can't mangle K&R function prototypes"); llvm_unreachable("Can't mangle K&R function prototypes");
} }
void CXXNameMangler::mangleBareFunctionType(const FunctionType *T, void CXXNameMangler::mangleBareFunctionType(const FunctionType *T,
bool MangleReturnType) { bool MangleReturnType) {

View File

@@ -510,7 +510,7 @@ DerivedArgList *Darwin::TranslateArgs(InputArgList &Args,
DAL->append(DAL->MakeJoinedArg(0, MArch, "armv7a")); DAL->append(DAL->MakeJoinedArg(0, MArch, "armv7a"));
else else
llvm::llvm_unreachable("invalid Darwin arch"); llvm_unreachable("invalid Darwin arch");
} }
return DAL; return DAL;

View File

@@ -31,7 +31,7 @@ using namespace clang;
static const char *getAnalysisName(Analyses Kind) { static const char *getAnalysisName(Analyses Kind) {
switch (Kind) { switch (Kind) {
default: default:
llvm::llvm_unreachable("Unknown analysis kind!"); llvm_unreachable("Unknown analysis kind!");
#define ANALYSIS(NAME, CMDFLAG, DESC, SCOPE)\ #define ANALYSIS(NAME, CMDFLAG, DESC, SCOPE)\
case NAME: return "-" CMDFLAG; case NAME: return "-" CMDFLAG;
#include "clang/Frontend/Analyses.def" #include "clang/Frontend/Analyses.def"
@@ -41,7 +41,7 @@ static const char *getAnalysisName(Analyses Kind) {
static const char *getAnalysisStoreName(AnalysisStores Kind) { static const char *getAnalysisStoreName(AnalysisStores Kind) {
switch (Kind) { switch (Kind) {
default: default:
llvm::llvm_unreachable("Unknown analysis store!"); llvm_unreachable("Unknown analysis store!");
#define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN) \ #define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN) \
case NAME##Model: return CMDFLAG; case NAME##Model: return CMDFLAG;
#include "clang/Frontend/Analyses.def" #include "clang/Frontend/Analyses.def"
@@ -51,7 +51,7 @@ static const char *getAnalysisStoreName(AnalysisStores Kind) {
static const char *getAnalysisConstraintName(AnalysisConstraints Kind) { static const char *getAnalysisConstraintName(AnalysisConstraints Kind) {
switch (Kind) { switch (Kind) {
default: default:
llvm::llvm_unreachable("Unknown analysis constraints!"); llvm_unreachable("Unknown analysis constraints!");
#define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN) \ #define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN) \
case NAME##Model: return CMDFLAG; case NAME##Model: return CMDFLAG;
#include "clang/Frontend/Analyses.def" #include "clang/Frontend/Analyses.def"
@@ -61,7 +61,7 @@ static const char *getAnalysisConstraintName(AnalysisConstraints Kind) {
static const char *getAnalysisDiagClientName(AnalysisDiagClients Kind) { static const char *getAnalysisDiagClientName(AnalysisDiagClients Kind) {
switch (Kind) { switch (Kind) {
default: default:
llvm::llvm_unreachable("Unknown analysis client!"); llvm_unreachable("Unknown analysis client!");
#define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATFN, AUTOCREATE) \ #define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATFN, AUTOCREATE) \
case PD_##NAME: return CMDFLAG; case PD_##NAME: return CMDFLAG;
#include "clang/Frontend/Analyses.def" #include "clang/Frontend/Analyses.def"
@@ -246,7 +246,7 @@ static const char *getInputKindName(FrontendOptions::InputKind Kind) {
case FrontendOptions::IK_PreprocessedObjCXX:return "objective-c++-cpp-output"; case FrontendOptions::IK_PreprocessedObjCXX:return "objective-c++-cpp-output";
} }
llvm::llvm_unreachable("Unexpected language kind!"); llvm_unreachable("Unexpected language kind!");
return 0; return 0;
} }
@@ -254,7 +254,7 @@ static const char *getActionName(frontend::ActionKind Kind) {
switch (Kind) { switch (Kind) {
case frontend::PluginAction: case frontend::PluginAction:
case frontend::InheritanceView: case frontend::InheritanceView:
llvm::llvm_unreachable("Invalid kind!"); llvm_unreachable("Invalid kind!");
case frontend::ASTDump: return "-ast-dump"; case frontend::ASTDump: return "-ast-dump";
case frontend::ASTPrint: return "-ast-print"; case frontend::ASTPrint: return "-ast-print";
@@ -284,7 +284,7 @@ static const char *getActionName(frontend::ActionKind Kind) {
case frontend::RunPreprocessorOnly: return "-Eonly"; case frontend::RunPreprocessorOnly: return "-Eonly";
} }
llvm::llvm_unreachable("Unexpected language kind!"); llvm_unreachable("Unexpected language kind!");
return 0; return 0;
} }

View File

@@ -222,5 +222,5 @@ void ASTFrontendAction::ExecuteAction() {
ASTConsumer * ASTConsumer *
PreprocessorFrontendAction::CreateASTConsumer(CompilerInstance &CI, PreprocessorFrontendAction::CreateASTConsumer(CompilerInstance &CI,
llvm::StringRef InFile) { llvm::StringRef InFile) {
llvm::llvm_unreachable("Invalid CreateASTConsumer on preprocessor action!"); llvm_unreachable("Invalid CreateASTConsumer on preprocessor action!");
} }

View File

@@ -20,7 +20,7 @@ using namespace clang::frontend;
const LangStandard &LangStandard::getLangStandardForKind(Kind K) { const LangStandard &LangStandard::getLangStandardForKind(Kind K) {
switch (K) { switch (K) {
default: default:
llvm::llvm_unreachable("Invalid language kind!"); llvm_unreachable("Invalid language kind!");
case lang_unspecified: case lang_unspecified:
llvm::llvm_report_error("getLangStandardForKind() on unspecified kind"); llvm::llvm_report_error("getLangStandardForKind() on unspecified kind");
#define LANGSTANDARD(id, name, desc, features) \ #define LANGSTANDARD(id, name, desc, features) \

View File

@@ -2207,7 +2207,7 @@ PCHReader::GetTemplateArgumentLocInfo(TemplateArgument::ArgKind Kind,
case TemplateArgument::Pack: case TemplateArgument::Pack:
return TemplateArgumentLocInfo(); return TemplateArgumentLocInfo();
} }
llvm::llvm_unreachable("unexpected template argument loc"); llvm_unreachable("unexpected template argument loc");
return TemplateArgumentLocInfo(); return TemplateArgumentLocInfo();
} }

View File

@@ -137,7 +137,7 @@ const char *DeclSpec::getSpecifierName(DeclSpec::SCS S) {
case DeclSpec::SCS_private_extern: return "__private_extern__"; case DeclSpec::SCS_private_extern: return "__private_extern__";
case DeclSpec::SCS_mutable: return "mutable"; case DeclSpec::SCS_mutable: return "mutable";
} }
llvm::llvm_unreachable("Unknown typespec!"); llvm_unreachable("Unknown typespec!");
} }
const char *DeclSpec::getSpecifierName(TSW W) { const char *DeclSpec::getSpecifierName(TSW W) {
@@ -147,7 +147,7 @@ const char *DeclSpec::getSpecifierName(TSW W) {
case TSW_long: return "long"; case TSW_long: return "long";
case TSW_longlong: return "long long"; case TSW_longlong: return "long long";
} }
llvm::llvm_unreachable("Unknown typespec!"); llvm_unreachable("Unknown typespec!");
} }
const char *DeclSpec::getSpecifierName(TSC C) { const char *DeclSpec::getSpecifierName(TSC C) {
@@ -156,7 +156,7 @@ const char *DeclSpec::getSpecifierName(TSC C) {
case TSC_imaginary: return "imaginary"; case TSC_imaginary: return "imaginary";
case TSC_complex: return "complex"; case TSC_complex: return "complex";
} }
llvm::llvm_unreachable("Unknown typespec!"); llvm_unreachable("Unknown typespec!");
} }
@@ -166,7 +166,7 @@ const char *DeclSpec::getSpecifierName(TSS S) {
case TSS_signed: return "signed"; case TSS_signed: return "signed";
case TSS_unsigned: return "unsigned"; case TSS_unsigned: return "unsigned";
} }
llvm::llvm_unreachable("Unknown typespec!"); llvm_unreachable("Unknown typespec!");
} }
const char *DeclSpec::getSpecifierName(DeclSpec::TST T) { const char *DeclSpec::getSpecifierName(DeclSpec::TST T) {
@@ -195,7 +195,7 @@ const char *DeclSpec::getSpecifierName(DeclSpec::TST T) {
case DeclSpec::TST_decltype: return "(decltype)"; case DeclSpec::TST_decltype: return "(decltype)";
case DeclSpec::TST_error: return "(error)"; case DeclSpec::TST_error: return "(error)";
} }
llvm::llvm_unreachable("Unknown typespec!"); llvm_unreachable("Unknown typespec!");
} }
const char *DeclSpec::getSpecifierName(TQ T) { const char *DeclSpec::getSpecifierName(TQ T) {
@@ -205,7 +205,7 @@ const char *DeclSpec::getSpecifierName(TQ T) {
case DeclSpec::TQ_restrict: return "restrict"; case DeclSpec::TQ_restrict: return "restrict";
case DeclSpec::TQ_volatile: return "volatile"; case DeclSpec::TQ_volatile: return "volatile";
} }
llvm::llvm_unreachable("Unknown typespec!"); llvm_unreachable("Unknown typespec!");
} }
bool DeclSpec::SetStorageClassSpec(SCS S, SourceLocation Loc, bool DeclSpec::SetStorageClassSpec(SCS S, SourceLocation Loc,

View File

@@ -46,7 +46,7 @@ CodeCompletionString::Chunk::Chunk(ChunkKind Kind, llvm::StringRef Text)
} }
case CK_Optional: case CK_Optional:
llvm::llvm_unreachable("Optional strings cannot be created from text"); llvm_unreachable("Optional strings cannot be created from text");
break; break;
case CK_LeftParen: case CK_LeftParen:

View File

@@ -1352,7 +1352,7 @@ namespace {
case Result::RK_Keyword: case Result::RK_Keyword:
case Result::RK_Pattern: case Result::RK_Pattern:
llvm::llvm_unreachable("Result kinds handled above"); llvm_unreachable("Result kinds handled above");
break; break;
} }

View File

@@ -2913,13 +2913,13 @@ bool InitializationSequence::Diagnose(Sema &S,
S.Diag(Best->Function->getLocation(), diag::note_unavailable_here) S.Diag(Best->Function->getLocation(), diag::note_unavailable_here)
<< Best->Function->isDeleted(); << Best->Function->isDeleted();
} else { } else {
llvm::llvm_unreachable("Inconsistent overload resolution?"); llvm_unreachable("Inconsistent overload resolution?");
} }
break; break;
} }
case OR_Success: case OR_Success:
llvm::llvm_unreachable("Conversion did not fail!"); llvm_unreachable("Conversion did not fail!");
break; break;
} }
break; break;

View File

@@ -1167,7 +1167,7 @@ bool Sema::DiagnoseAmbiguousLookup(LookupResult &Result) {
} }
} }
llvm::llvm_unreachable("unknown ambiguity kind"); llvm_unreachable("unknown ambiguity kind");
return true; return true;
} }

View File

@@ -351,7 +351,7 @@ static TemplateArgumentLoc translateTemplateArgument(Sema &SemaRef,
} }
} }
llvm::llvm_unreachable("Unhandled parsed template argument"); llvm_unreachable("Unhandled parsed template argument");
return TemplateArgumentLoc(); return TemplateArgumentLoc();
} }
@@ -1916,7 +1916,7 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param,
} }
case TemplateArgument::Pack: case TemplateArgument::Pack:
llvm::llvm_unreachable("Caller must expand template argument packs"); llvm_unreachable("Caller must expand template argument packs");
break; break;
} }
@@ -1969,16 +1969,16 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param,
return true; return true;
case TemplateArgument::Declaration: case TemplateArgument::Declaration:
llvm::llvm_unreachable( llvm_unreachable(
"Declaration argument with template template parameter"); "Declaration argument with template template parameter");
break; break;
case TemplateArgument::Integral: case TemplateArgument::Integral:
llvm::llvm_unreachable( llvm_unreachable(
"Integral argument with template template parameter"); "Integral argument with template template parameter");
break; break;
case TemplateArgument::Pack: case TemplateArgument::Pack:
llvm::llvm_unreachable("Caller must expand template argument packs"); llvm_unreachable("Caller must expand template argument packs");
break; break;
} }
@@ -4695,7 +4695,7 @@ Sema::CheckTypenameType(NestedNameSpecifier *NNS, const IdentifierInfo &II,
break; break;
case LookupResult::FoundUnresolvedValue: case LookupResult::FoundUnresolvedValue:
llvm::llvm_unreachable("unresolved using decl in non-dependent context"); llvm_unreachable("unresolved using decl in non-dependent context");
return QualType(); return QualType();
case LookupResult::FoundOverloaded: case LookupResult::FoundOverloaded:

View File

@@ -1193,7 +1193,7 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
case NestedNameSpecifier::Namespace: case NestedNameSpecifier::Namespace:
case NestedNameSpecifier::Global: case NestedNameSpecifier::Global:
llvm::llvm_unreachable("Nested-name-specifier must name a type"); llvm_unreachable("Nested-name-specifier must name a type");
break; break;
case NestedNameSpecifier::TypeSpec: case NestedNameSpecifier::TypeSpec:
@@ -1360,7 +1360,7 @@ namespace {
DeclaratorLocFiller(const DeclaratorChunk &Chunk) : Chunk(Chunk) {} DeclaratorLocFiller(const DeclaratorChunk &Chunk) : Chunk(Chunk) {}
void VisitQualifiedTypeLoc(QualifiedTypeLoc TL) { void VisitQualifiedTypeLoc(QualifiedTypeLoc TL) {
llvm::llvm_unreachable("qualified type locs not expected here!"); llvm_unreachable("qualified type locs not expected here!");
} }
void VisitBlockPointerTypeLoc(BlockPointerTypeLoc TL) { void VisitBlockPointerTypeLoc(BlockPointerTypeLoc TL) {
@@ -1415,7 +1415,7 @@ namespace {
} }
void VisitTypeLoc(TypeLoc TL) { void VisitTypeLoc(TypeLoc TL) {
llvm::llvm_unreachable("unsupported TypeLoc kind in declarator!"); llvm_unreachable("unsupported TypeLoc kind in declarator!");
} }
}; };
} }

View File

@@ -1871,7 +1871,7 @@ void TreeTransform<Derived>::InventTemplateArgumentLoc(
SourceLocation Loc = getDerived().getBaseLocation(); SourceLocation Loc = getDerived().getBaseLocation();
switch (Arg.getKind()) { switch (Arg.getKind()) {
case TemplateArgument::Null: case TemplateArgument::Null:
llvm::llvm_unreachable("null template argument in TreeTransform"); llvm_unreachable("null template argument in TreeTransform");
break; break;
case TemplateArgument::Type: case TemplateArgument::Type:
@@ -2056,7 +2056,7 @@ TreeTransform<Derived>::TransformType(TypeLocBuilder &TLB, TypeLoc T) {
#include "clang/AST/TypeLocNodes.def" #include "clang/AST/TypeLocNodes.def"
} }
llvm::llvm_unreachable("unhandled type loc!"); llvm_unreachable("unhandled type loc!");
return QualType(); return QualType();
} }

View File

@@ -63,7 +63,7 @@ static FrontendAction *CreateFrontendAction(CompilerInstance &CI) {
switch (CI.getFrontendOpts().ProgramAction) { switch (CI.getFrontendOpts().ProgramAction) {
default: default:
llvm::llvm_unreachable("Invalid program action!"); llvm_unreachable("Invalid program action!");
case ASTDump: return new ASTDumpAction(); case ASTDump: return new ASTDumpAction();
case ASTPrint: return new ASTPrintAction(); case ASTPrint: return new ASTPrintAction();