diff options
author | DeLesley Hutchins <delesley@google.com> | 2012-05-02 17:38:37 +0000 |
---|---|---|
committer | DeLesley Hutchins <delesley@google.com> | 2012-05-02 17:38:37 +0000 |
commit | f26efd79d1bd139641d0bb40842f908c67f041c2 (patch) | |
tree | aa550ce19e46bd7beb5096c0ce213f5dc18ec03b /lib/Sema/SemaDeclAttr.cpp | |
parent | f5eac481ab6da79f05ca13fd859b67abfd2ed246 (diff) |
Thread Safety Analysis: fixed attribute handling for lock_returned attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index c8af3a430a..13bf0aa487 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -681,9 +681,14 @@ static void handleLockReturnedAttr(Sema &S, Decl *D, return; // check that the argument is lockable object - checkForLockableRecord(S, D, Attr, Arg->getType()); + SmallVector<Expr*, 1> Args; + checkAttrArgsAreLockableObjs(S, D, Attr, Args); + unsigned Size = Args.size(); + if (Size == 0) + return; - D->addAttr(::new (S.Context) LockReturnedAttr(Attr.getRange(), S.Context, Arg)); + D->addAttr(::new (S.Context) LockReturnedAttr(Attr.getRange(), S.Context, + Args[0])); } static void handleLocksExcludedAttr(Sema &S, Decl *D, |