From: Jeffrey Yasskin Date: Sat, 12 Dec 2009 05:05:38 +0000 (+0000) Subject: Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f61aa9e280adea9fbf3365f0e4f6ed568c9885a;p=clang Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave no extra safety anyway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91207 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/TemplateBase.h b/include/clang/AST/TemplateBase.h index ee01d6695d..fe037992ad 100644 --- a/include/clang/AST/TemplateBase.h +++ b/include/clang/AST/TemplateBase.h @@ -356,7 +356,7 @@ public: assert(Kind == K_None); break; case TemplateArgument::Null: - llvm::llvm_unreachable("source info for null template argument?"); + llvm_unreachable("source info for null template argument?"); } } #endif diff --git a/include/clang/AST/TypeLocVisitor.h b/include/clang/AST/TypeLocVisitor.h index a62bb3f853..95ec175a53 100644 --- a/include/clang/AST/TypeLocVisitor.h +++ b/include/clang/AST/TypeLocVisitor.h @@ -33,7 +33,7 @@ public: case TypeLoc::CLASS: DISPATCH(CLASS##TypeLoc); #include "clang/AST/TypeLocNodes.def" } - llvm::llvm_unreachable("unexpected type loc class!"); + llvm_unreachable("unexpected type loc class!"); } RetTy Visit(UnqualTypeLoc TyLoc) { diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 212dd353c3..95934747d0 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1214,7 +1214,7 @@ TagDecl* TagDecl::getDefinition(ASTContext& C) const { TagDecl::TagKind TagDecl::getTagKindForTypeSpec(unsigned 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_class: return TK_class; case DeclSpec::TST_union: return TK_union; diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 6eca6a1fa2..6d9a268993 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1813,7 +1813,7 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx, } EvalResult EvalResult; 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.Val.isInt() && "ICE that isn't integer!"); Result = EvalResult.Val.getInt(); diff --git a/lib/Analysis/AnalysisContext.cpp b/lib/Analysis/AnalysisContext.cpp index 3a6cf42a3d..05e5196c5b 100644 --- a/lib/Analysis/AnalysisContext.cpp +++ b/lib/Analysis/AnalysisContext.cpp @@ -39,7 +39,7 @@ Stmt *AnalysisContext::getBody() { else if (const BlockDecl *BD = dyn_cast(D)) return BD->getBody(); - llvm::llvm_unreachable("unknown code decl"); + llvm_unreachable("unknown code decl"); } const ImplicitParamDecl *AnalysisContext::getSelfDecl() const { diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp index 07e7546637..0f201b5601 100644 --- a/lib/CodeGen/CGException.cpp +++ b/lib/CodeGen/CGException.cpp @@ -182,7 +182,7 @@ static void CopyObject(CodeGenFunction &CGF, const Expr *E, Callee, CallArgs, CopyCtor); CGF.setInvokeDest(PrevLandingPad); } 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), Callee, CallArgs, CopyCtor); } else - llvm::llvm_unreachable("uncopyable object"); + llvm_unreachable("uncopyable object"); } } diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 1cfcfb1ab1..761f34309b 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -891,7 +891,7 @@ GetLinkageForVariable(ASTContext &Context, const VarDecl *VD) { return CodeGenModule::GVA_StrongExternal; 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. case TSK_ImplicitInstantiation: diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index afc70fa479..2833484b78 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/lib/CodeGen/Mangle.cpp @@ -742,7 +742,7 @@ void CXXNameMangler::mangleType(QualType T) { #define ABSTRACT_TYPE(CLASS, PARENT) #define NON_CANONICAL_TYPE(CLASS, PARENT) \ 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; #define TYPE(CLASS, PARENT) \ case Type::CLASS: \ @@ -836,7 +836,7 @@ void CXXNameMangler::mangleType(const FunctionProtoType *T) { Out << 'E'; } 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, bool MangleReturnType) { diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index af639523f1..420573dea2 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -510,7 +510,7 @@ DerivedArgList *Darwin::TranslateArgs(InputArgList &Args, DAL->append(DAL->MakeJoinedArg(0, MArch, "armv7a")); else - llvm::llvm_unreachable("invalid Darwin arch"); + llvm_unreachable("invalid Darwin arch"); } return DAL; diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 3b9d5d07a0..61995b4367 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -31,7 +31,7 @@ using namespace clang; static const char *getAnalysisName(Analyses Kind) { switch (Kind) { default: - llvm::llvm_unreachable("Unknown analysis kind!"); + llvm_unreachable("Unknown analysis kind!"); #define ANALYSIS(NAME, CMDFLAG, DESC, SCOPE)\ case NAME: return "-" CMDFLAG; #include "clang/Frontend/Analyses.def" @@ -41,7 +41,7 @@ static const char *getAnalysisName(Analyses Kind) { static const char *getAnalysisStoreName(AnalysisStores Kind) { switch (Kind) { default: - llvm::llvm_unreachable("Unknown analysis store!"); + llvm_unreachable("Unknown analysis store!"); #define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN) \ case NAME##Model: return CMDFLAG; #include "clang/Frontend/Analyses.def" @@ -51,7 +51,7 @@ static const char *getAnalysisStoreName(AnalysisStores Kind) { static const char *getAnalysisConstraintName(AnalysisConstraints Kind) { switch (Kind) { default: - llvm::llvm_unreachable("Unknown analysis constraints!"); + llvm_unreachable("Unknown analysis constraints!"); #define ANALYSIS_CONSTRAINTS(NAME, CMDFLAG, DESC, CREATFN) \ case NAME##Model: return CMDFLAG; #include "clang/Frontend/Analyses.def" @@ -61,7 +61,7 @@ static const char *getAnalysisConstraintName(AnalysisConstraints Kind) { static const char *getAnalysisDiagClientName(AnalysisDiagClients Kind) { switch (Kind) { default: - llvm::llvm_unreachable("Unknown analysis client!"); + llvm_unreachable("Unknown analysis client!"); #define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATFN, AUTOCREATE) \ case PD_##NAME: return CMDFLAG; #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"; } - llvm::llvm_unreachable("Unexpected language kind!"); + llvm_unreachable("Unexpected language kind!"); return 0; } @@ -254,7 +254,7 @@ static const char *getActionName(frontend::ActionKind Kind) { switch (Kind) { case frontend::PluginAction: case frontend::InheritanceView: - llvm::llvm_unreachable("Invalid kind!"); + llvm_unreachable("Invalid kind!"); case frontend::ASTDump: return "-ast-dump"; case frontend::ASTPrint: return "-ast-print"; @@ -284,7 +284,7 @@ static const char *getActionName(frontend::ActionKind Kind) { case frontend::RunPreprocessorOnly: return "-Eonly"; } - llvm::llvm_unreachable("Unexpected language kind!"); + llvm_unreachable("Unexpected language kind!"); return 0; } diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp index e244d3cc21..96a68c931e 100644 --- a/lib/Frontend/FrontendAction.cpp +++ b/lib/Frontend/FrontendAction.cpp @@ -222,5 +222,5 @@ void ASTFrontendAction::ExecuteAction() { ASTConsumer * PreprocessorFrontendAction::CreateASTConsumer(CompilerInstance &CI, llvm::StringRef InFile) { - llvm::llvm_unreachable("Invalid CreateASTConsumer on preprocessor action!"); + llvm_unreachable("Invalid CreateASTConsumer on preprocessor action!"); } diff --git a/lib/Frontend/LangStandards.cpp b/lib/Frontend/LangStandards.cpp index 08fd9329f2..ed0ea1f45e 100644 --- a/lib/Frontend/LangStandards.cpp +++ b/lib/Frontend/LangStandards.cpp @@ -20,7 +20,7 @@ using namespace clang::frontend; const LangStandard &LangStandard::getLangStandardForKind(Kind K) { switch (K) { default: - llvm::llvm_unreachable("Invalid language kind!"); + llvm_unreachable("Invalid language kind!"); case lang_unspecified: llvm::llvm_report_error("getLangStandardForKind() on unspecified kind"); #define LANGSTANDARD(id, name, desc, features) \ diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index 58209c8701..48ef2ac31a 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -2207,7 +2207,7 @@ PCHReader::GetTemplateArgumentLocInfo(TemplateArgument::ArgKind Kind, case TemplateArgument::Pack: return TemplateArgumentLocInfo(); } - llvm::llvm_unreachable("unexpected template argument loc"); + llvm_unreachable("unexpected template argument loc"); return TemplateArgumentLocInfo(); } diff --git a/lib/Parse/DeclSpec.cpp b/lib/Parse/DeclSpec.cpp index f00f33fcb9..4cd8fe887b 100644 --- a/lib/Parse/DeclSpec.cpp +++ b/lib/Parse/DeclSpec.cpp @@ -137,7 +137,7 @@ const char *DeclSpec::getSpecifierName(DeclSpec::SCS S) { case DeclSpec::SCS_private_extern: return "__private_extern__"; case DeclSpec::SCS_mutable: return "mutable"; } - llvm::llvm_unreachable("Unknown typespec!"); + llvm_unreachable("Unknown typespec!"); } const char *DeclSpec::getSpecifierName(TSW W) { @@ -147,7 +147,7 @@ const char *DeclSpec::getSpecifierName(TSW W) { case TSW_long: return "long"; case TSW_longlong: return "long long"; } - llvm::llvm_unreachable("Unknown typespec!"); + llvm_unreachable("Unknown typespec!"); } const char *DeclSpec::getSpecifierName(TSC C) { @@ -156,7 +156,7 @@ const char *DeclSpec::getSpecifierName(TSC C) { case TSC_imaginary: return "imaginary"; 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_unsigned: return "unsigned"; } - llvm::llvm_unreachable("Unknown typespec!"); + llvm_unreachable("Unknown typespec!"); } 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_error: return "(error)"; } - llvm::llvm_unreachable("Unknown typespec!"); + llvm_unreachable("Unknown typespec!"); } 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_volatile: return "volatile"; } - llvm::llvm_unreachable("Unknown typespec!"); + llvm_unreachable("Unknown typespec!"); } bool DeclSpec::SetStorageClassSpec(SCS S, SourceLocation Loc, diff --git a/lib/Sema/CodeCompleteConsumer.cpp b/lib/Sema/CodeCompleteConsumer.cpp index 91b16d3774..d8ed8949cb 100644 --- a/lib/Sema/CodeCompleteConsumer.cpp +++ b/lib/Sema/CodeCompleteConsumer.cpp @@ -46,7 +46,7 @@ CodeCompletionString::Chunk::Chunk(ChunkKind Kind, llvm::StringRef Text) } case CK_Optional: - llvm::llvm_unreachable("Optional strings cannot be created from text"); + llvm_unreachable("Optional strings cannot be created from text"); break; case CK_LeftParen: diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 654bf25944..42ac6f19b0 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -1352,7 +1352,7 @@ namespace { case Result::RK_Keyword: case Result::RK_Pattern: - llvm::llvm_unreachable("Result kinds handled above"); + llvm_unreachable("Result kinds handled above"); break; } diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index a1fd79b852..db5643898b 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -2913,13 +2913,13 @@ bool InitializationSequence::Diagnose(Sema &S, S.Diag(Best->Function->getLocation(), diag::note_unavailable_here) << Best->Function->isDeleted(); } else { - llvm::llvm_unreachable("Inconsistent overload resolution?"); + llvm_unreachable("Inconsistent overload resolution?"); } break; } case OR_Success: - llvm::llvm_unreachable("Conversion did not fail!"); + llvm_unreachable("Conversion did not fail!"); break; } break; diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 7428e941d5..724e2fc1e4 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -1167,7 +1167,7 @@ bool Sema::DiagnoseAmbiguousLookup(LookupResult &Result) { } } - llvm::llvm_unreachable("unknown ambiguity kind"); + llvm_unreachable("unknown ambiguity kind"); return true; } diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 3ac6bbac5b..9fa57c03ea 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -351,7 +351,7 @@ static TemplateArgumentLoc translateTemplateArgument(Sema &SemaRef, } } - llvm::llvm_unreachable("Unhandled parsed template argument"); + llvm_unreachable("Unhandled parsed template argument"); return TemplateArgumentLoc(); } @@ -1916,7 +1916,7 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param, } case TemplateArgument::Pack: - llvm::llvm_unreachable("Caller must expand template argument packs"); + llvm_unreachable("Caller must expand template argument packs"); break; } @@ -1969,16 +1969,16 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param, return true; case TemplateArgument::Declaration: - llvm::llvm_unreachable( + llvm_unreachable( "Declaration argument with template template parameter"); break; case TemplateArgument::Integral: - llvm::llvm_unreachable( + llvm_unreachable( "Integral argument with template template parameter"); break; case TemplateArgument::Pack: - llvm::llvm_unreachable("Caller must expand template argument packs"); + llvm_unreachable("Caller must expand template argument packs"); break; } @@ -4695,7 +4695,7 @@ Sema::CheckTypenameType(NestedNameSpecifier *NNS, const IdentifierInfo &II, break; case LookupResult::FoundUnresolvedValue: - llvm::llvm_unreachable("unresolved using decl in non-dependent context"); + llvm_unreachable("unresolved using decl in non-dependent context"); return QualType(); case LookupResult::FoundOverloaded: diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index c52ac75332..37f19f2be4 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -1193,7 +1193,7 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S, case NestedNameSpecifier::Namespace: case NestedNameSpecifier::Global: - llvm::llvm_unreachable("Nested-name-specifier must name a type"); + llvm_unreachable("Nested-name-specifier must name a type"); break; case NestedNameSpecifier::TypeSpec: @@ -1360,7 +1360,7 @@ namespace { DeclaratorLocFiller(const DeclaratorChunk &Chunk) : Chunk(Chunk) {} 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) { @@ -1415,7 +1415,7 @@ namespace { } void VisitTypeLoc(TypeLoc TL) { - llvm::llvm_unreachable("unsupported TypeLoc kind in declarator!"); + llvm_unreachable("unsupported TypeLoc kind in declarator!"); } }; } diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index be3c04302e..643489fa37 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -1871,7 +1871,7 @@ void TreeTransform::InventTemplateArgumentLoc( SourceLocation Loc = getDerived().getBaseLocation(); switch (Arg.getKind()) { case TemplateArgument::Null: - llvm::llvm_unreachable("null template argument in TreeTransform"); + llvm_unreachable("null template argument in TreeTransform"); break; case TemplateArgument::Type: @@ -2056,7 +2056,7 @@ TreeTransform::TransformType(TypeLocBuilder &TLB, TypeLoc T) { #include "clang/AST/TypeLocNodes.def" } - llvm::llvm_unreachable("unhandled type loc!"); + llvm_unreachable("unhandled type loc!"); return QualType(); } diff --git a/tools/driver/cc1_main.cpp b/tools/driver/cc1_main.cpp index 58eef022c7..9c50ccdeba 100644 --- a/tools/driver/cc1_main.cpp +++ b/tools/driver/cc1_main.cpp @@ -63,7 +63,7 @@ static FrontendAction *CreateFrontendAction(CompilerInstance &CI) { switch (CI.getFrontendOpts().ProgramAction) { default: - llvm::llvm_unreachable("Invalid program action!"); + llvm_unreachable("Invalid program action!"); case ASTDump: return new ASTDumpAction(); case ASTPrint: return new ASTPrintAction();