diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-07-01 22:23:05 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-07-01 22:23:05 +0000 |
| commit | 9ab661b163feda9ad40d07464a66c1c48360e238 (patch) | |
| tree | 6d597be02d57c4cf59d2be521672547137b8692e /clang | |
| parent | ea57a9be176fcf0f88e3349d7ca0793c04329a08 (diff) | |
| download | bcm5719-llvm-9ab661b163feda9ad40d07464a66c1c48360e238.tar.gz bcm5719-llvm-9ab661b163feda9ad40d07464a66c1c48360e238.zip | |
Use transferARCOwnershipToDeclaratorChunk in inferARCWriteback, no functionality change.
llvm-svn: 134277
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Sema/SemaType.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index 72f88104da2..cc4389ef15b 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/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; |

