]> granicus.if.org Git - clang/commitdiff
Some minor cleanups, thanks Chris.
authorMike Stump <mrs@apple.com>
Tue, 28 Jul 2009 23:57:15 +0000 (23:57 +0000)
committerMike Stump <mrs@apple.com>
Tue, 28 Jul 2009 23:57:15 +0000 (23:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77402 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ASTContext.h
lib/AST/ASTContext.cpp
lib/Sema/SemaDecl.cpp

index 96ffcc7c4ebd7a9742cf9d577a6d128247772361..60aead7e3318bea43ae4e89c575bd7a06355760f 100644 (file)
@@ -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.
index 4da20f5a60dc2ad077b651444bf6cd9880c15dbc..931010d90465f0f73db6525f904b7723dc436701 100644 (file)
@@ -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;
index c6fb6d97bdf6e0226e7aaed50a3b9662140caf2f..5f405b2430871685cd386695a3bf15327d6d2a0d 100644 (file)
@@ -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);