aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-07-28 23:57:15 +0000
committerMike Stump <mrs@apple.com>2009-07-28 23:57:15 +0000
commitf711c41dd9412a8182793259d355c4f6979ed5ed (patch)
treec81c43f15d2b1eaeaa62660055c4cc48f5aa0380
parentfd612dbb23cd31c03c898ae53ff18d0dfd8488f9 (diff)
Some minor cleanups, thanks Chris.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77402 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/ASTContext.h5
-rw-r--r--lib/AST/ASTContext.cpp16
-rw-r--r--lib/Sema/SemaDecl.cpp10
3 files changed, 10 insertions, 21 deletions
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 <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/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);