[cfe-commits] r134277 - /cfe/trunk/lib/Sema/SemaType.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Fri Jul 1 15:23:05 PDT 2011


Author: akirtzidis
Date: Fri Jul  1 17:23:05 2011
New Revision: 134277

URL: http://llvm.org/viewvc/llvm-project?rev=134277&view=rev
Log:
Use transferARCOwnershipToDeclaratorChunk in inferARCWriteback, no functionality change.

Modified:
    cfe/trunk/lib/Sema/SemaType.cpp

Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=134277&r1=134276&r2=134277&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Fri Jul  1 17:23:05 2011
@@ -1562,6 +1562,10 @@
   return QT;
 }
 
+static void transferARCOwnershipToDeclaratorChunk(TypeProcessingState &state,
+                                            Qualifiers::ObjCLifetime ownership,
+                                            unsigned chunkIndex);
+
 /// Given that this is the declaration of a parameter under ARC,
 /// attempt to infer attributes and such for pointer-to-whatever
 /// types.
@@ -1652,15 +1656,8 @@
       if (attr->getKind() == AttributeList::AT_objc_ownership)
         return;
 
-    // If there wasn't one, add one (with an invalid source location
-    // so that we don't make an AttributedType for it).
-    AttributeList *attr = declarator.getAttributePool()
-      .create(&S.Context.Idents.get("objc_ownership"), SourceLocation(),
-              /*scope*/ 0, SourceLocation(),
-              &S.Context.Idents.get("autoreleasing"), SourceLocation(),
-              /*args*/ 0, 0,
-              /*declspec*/ false, /*C++0x*/ false);
-    spliceAttrIntoList(*attr, chunk.getAttrListRef());
+    transferARCOwnershipToDeclaratorChunk(state, Qualifiers::OCL_Autoreleasing,
+                                          outermostPointerIndex);
 
   // Any other number of pointers/references does not trigger the rule.
   } else return;





More information about the cfe-commits mailing list