[cfe-commits] r95733 - in /cfe/trunk: lib/AST/ASTContext.cpp test/SemaObjC/gc-attr-block-ivar.m test/SemaObjC/objc2-merge-gc-attribue-decl.m

Fariborz Jahanian fjahanian at apple.com
Tue Feb 9 16:32:12 PST 2010


Author: fjahanian
Date: Tue Feb  9 18:32:12 2010
New Revision: 95733

URL: http://llvm.org/viewvc/llvm-project?rev=95733&view=rev
Log:
Reverse a partial fix patch for radar 7214820. It broke some code and
I don't have time to refix it for now.

Removed:
    cfe/trunk/test/SemaObjC/gc-attr-block-ivar.m
Modified:
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/test/SemaObjC/objc2-merge-gc-attribue-decl.m

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=95733&r1=95732&r2=95733&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Tue Feb  9 18:32:12 2010
@@ -4311,24 +4311,11 @@
   bool allRTypes = true;
 
   // Check return type
-  QualType LRES = lbase->getResultType();
-  QualType RRES = rbase->getResultType();
-  Qualifiers::GC GC_L = LRES.getObjCGCAttr();
-  Qualifiers::GC GC_R = RRES.getObjCGCAttr();
-  // __weak/__strong attribute on one function/block return type but
-  // not the other is OK.
-  if (GC_L != GC_R) {
-    if (GC_R == Qualifiers::GCNone)
-      RRES = getObjCGCQualType(RRES, GC_L);
-    else if (GC_L == Qualifiers::GCNone)
-      LRES = getObjCGCQualType(LRES, GC_R);
-  }
-  
-  QualType retType = mergeTypes(LRES, RRES);
+  QualType retType = mergeTypes(lbase->getResultType(), rbase->getResultType());
   if (retType.isNull()) return QualType();
-  if (getCanonicalType(retType) != getCanonicalType(LRES))
+  if (getCanonicalType(retType) != getCanonicalType(lbase->getResultType()))
     allLTypes = false;
-  if (getCanonicalType(retType) != getCanonicalType(RRES))
+  if (getCanonicalType(retType) != getCanonicalType(rbase->getResultType()))
     allRTypes = false;
   // FIXME: double check this
   bool NoReturn = lbase->getNoReturnAttr() || rbase->getNoReturnAttr();

Removed: cfe/trunk/test/SemaObjC/gc-attr-block-ivar.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/gc-attr-block-ivar.m?rev=95732&view=auto

==============================================================================
--- cfe/trunk/test/SemaObjC/gc-attr-block-ivar.m (original)
+++ cfe/trunk/test/SemaObjC/gc-attr-block-ivar.m (removed)
@@ -1,17 +0,0 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -fblocks -fobjc-gc %s
-
- at interface Intf  {
- at public
-    void (^block) (id);
-    __weak void (^weak_block) (id);
-    void (*fptr) (id);
-    __weak void (*weak_fptr) (id);
-}
- at end
-
-int main() {
-    Intf *observer;
-    return (observer->block != observer->weak_block ||
-            observer->fptr != observer->weak_fptr);
-}
-

Modified: cfe/trunk/test/SemaObjC/objc2-merge-gc-attribue-decl.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/objc2-merge-gc-attribue-decl.m?rev=95733&r1=95732&r2=95733&view=diff

==============================================================================
--- cfe/trunk/test/SemaObjC/objc2-merge-gc-attribue-decl.m (original)
+++ cfe/trunk/test/SemaObjC/objc2-merge-gc-attribue-decl.m Tue Feb  9 18:32:12 2010
@@ -10,8 +10,8 @@
 extern id CFRunLoopGetMain();
 extern __strong id CFRunLoopGetMain();
 
-extern __weak id WLoopGetMain(); 
-extern id WLoopGetMain();	
+extern __weak id WLoopGetMain(); // expected-note {{previous declaration is here}}
+extern id WLoopGetMain();	// expected-error {{conflicting types for 'WLoopGetMain'}}
 
 extern id p3;	// expected-note {{previous definition is here}}
 extern __weak id p3;	// expected-error {{redefinition of 'p3' with a different type}}





More information about the cfe-commits mailing list