aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-07-01 22:23:05 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-07-01 22:23:05 +0000
commita8349f5e60d1b5b0e658195a60d385b56ed440ec (patch)
treecfa90458ebb71626d30c15e3cb28fe606dae24d2
parent1c73dcbe1f1921bad8311cfb5089d30b4bd75b66 (diff)
Use transferARCOwnershipToDeclaratorChunk in inferARCWriteback, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134277 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaType.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 72f88104da..cc4389ef15 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -1562,6 +1562,10 @@ QualType Sema::GetTypeFromParser(ParsedType Ty, TypeSourceInfo **TInfo) {
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 @@ static void inferARCWriteback(TypeProcessingState &state,
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;