diff options
-rw-r--r-- | clang/include/clang/AST/ASTContext.h | 5 | ||||
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 16 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 10 |
3 files changed, 10 insertions, 21 deletions
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 96ffcc7c4eb..60aead7e331 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -589,9 +589,8 @@ public: enum GetBuiltinTypeError { GE_None, //< No error - GE_Missing_FILE, //< Missing the FILE type from <stdio.h> - GE_Missing_jmp_buf, //< Missing the jmp_buf type from <setjmp.h> - GE_Missing_sigjmp_buf //< Missing the sigjmp_buf type from <setjmp.h> + GE_Missing_stdio, //< Missing a type from <stdio.h> + GE_Missing_setjmp //< Missing a type from <setjmp.h> }; /// GetBuiltinType - Return the type for the specified builtin. diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 4da20f5a60d..931010d9046 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/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/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index c6fb6d97bdf..5f405b24308 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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); |