From: Mike Stump Date: Tue, 28 Jul 2009 23:57:15 +0000 (+0000) Subject: Some minor cleanups, thanks Chris. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f711c41dd9412a8182793259d355c4f6979ed5ed;p=clang Some minor cleanups, thanks Chris. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77402 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 96ffcc7c4e..60aead7e33 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -589,9 +589,8 @@ public: enum GetBuiltinTypeError { GE_None, //< No error - GE_Missing_FILE, //< Missing the FILE type from - GE_Missing_jmp_buf, //< Missing the jmp_buf type from - GE_Missing_sigjmp_buf //< Missing the sigjmp_buf type from + GE_Missing_stdio, //< Missing a type from + GE_Missing_setjmp //< Missing a type from }; /// GetBuiltinType - Return the type for the specified builtin. diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 4da20f5a60..931010d904 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -3976,22 +3976,18 @@ static QualType DecodeTypeFromStr(const char *&Str, ASTContext &Context, case 'P': Type = Context.getFILEType(); if (Type.isNull()) { - Error = ASTContext::GE_Missing_FILE; + Error = ASTContext::GE_Missing_stdio; return QualType(); } break; case 'J': - if (Signed) { + if (Signed) Type = Context.getsigjmp_bufType(); - if (Type.isNull()) { - Error = ASTContext::GE_Missing_sigjmp_buf; - return QualType(); - } - break; - } - Type = Context.getjmp_bufType(); + else + Type = Context.getjmp_bufType(); + if (Type.isNull()) { - Error = ASTContext::GE_Missing_jmp_buf; + Error = ASTContext::GE_Missing_setjmp; return QualType(); } break; diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index c6fb6d97bd..5f405b2430 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -448,19 +448,13 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned bid, // Okay break; - case ASTContext::GE_Missing_FILE: + case ASTContext::GE_Missing_stdio: if (ForRedeclaration) Diag(Loc, diag::err_implicit_decl_requires_stdio) << Context.BuiltinInfo.GetName(BID); return 0; - case ASTContext::GE_Missing_jmp_buf: - if (ForRedeclaration) - Diag(Loc, diag::err_implicit_decl_requires_setjmp) - << Context.BuiltinInfo.GetName(BID); - return 0; - - case ASTContext::GE_Missing_sigjmp_buf: + case ASTContext::GE_Missing_setjmp: if (ForRedeclaration) Diag(Loc, diag::err_implicit_decl_requires_setjmp) << Context.BuiltinInfo.GetName(BID);