[cfe-commits] r43515 - in /cfe/trunk/Sema: Sema.cpp SemaDecl.cpp

Chris Lattner sabre at nondot.org
Tue Oct 30 13:57:56 PDT 2007


Author: lattner
Date: Tue Oct 30 15:57:56 2007
New Revision: 43515

URL: http://llvm.org/viewvc/llvm-project?rev=43515&view=rev
Log:
minor tweaks

Modified:
    cfe/trunk/Sema/Sema.cpp
    cfe/trunk/Sema/SemaDecl.cpp

Modified: cfe/trunk/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/Sema.cpp?rev=43515&r1=43514&r2=43515&view=diff

==============================================================================
--- cfe/trunk/Sema/Sema.cpp (original)
+++ cfe/trunk/Sema/Sema.cpp Tue Oct 30 15:57:56 2007
@@ -31,17 +31,18 @@
 /// For now, we will *not* install id as a built-in. FIXME: reconsider this.
 QualType Sema::GetObjcIdType(SourceLocation Loc) {
   assert(TUScope && "GetObjcIdType(): Top-level scope is null");
-  if (Context.getObjcIdType().isNull()) {
-    IdentifierInfo *IdIdent = &Context.Idents.get("id");
-    ScopedDecl *IdDecl = LookupScopedDecl(IdIdent, Decl::IDNS_Ordinary, 
-                                          SourceLocation(), TUScope);
-    TypedefDecl *ObjcIdTypedef = dyn_cast_or_null<TypedefDecl>(IdDecl);
-    if (!ObjcIdTypedef) {
-      Diag(Loc, diag::err_missing_id_definition);
-      return QualType();
-    }
-    Context.setObjcIdType(ObjcIdTypedef);
+  if (!Context.getObjcIdType().isNull())
+    return Context.getObjcIdType();
+    
+  IdentifierInfo *IdIdent = &Context.Idents.get("id");
+  ScopedDecl *IdDecl = LookupScopedDecl(IdIdent, Decl::IDNS_Ordinary, 
+                                        SourceLocation(), TUScope);
+  TypedefDecl *ObjcIdTypedef = dyn_cast_or_null<TypedefDecl>(IdDecl);
+  if (!ObjcIdTypedef) {
+    Diag(Loc, diag::err_missing_id_definition);
+    return QualType();
   }
+  Context.setObjcIdType(ObjcIdTypedef);
   return Context.getObjcIdType();
 }
 

Modified: cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaDecl.cpp?rev=43515&r1=43514&r2=43515&view=diff

==============================================================================
--- cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/Sema/SemaDecl.cpp Tue Oct 30 15:57:56 2007
@@ -1194,9 +1194,9 @@
   if (!IDecl || IDecl->isForwardDecl())
     Diag(ClassLoc, diag::err_undef_interface, ClassName->getName());
   
-  // We cannot build type 'id' laziliy. It is needed when checking if a 
+  // We cannot build type 'id' lazily. It is needed when checking if a 
   // type is an 'id' (via call to isObjcIdType) even if there is no
-  // need for the dafult 'id' type.
+  // need for the default 'id' type.
   // FIXME: Depending on the need to compare to 'id', this may have to go
   // somewhere else. At this time, this is a good enough place to do type
   // encoding of methods and ivars for the rewrite client.





More information about the cfe-commits mailing list