[cfe-commits] r139805 - in /cfe/trunk: include/clang/Basic/Attr.td lib/Sema/SemaDeclAttr.cpp
Caitlin Sadowski
supertri at google.com
Thu Sep 15 10:50:19 PDT 2011
Author: supertri
Date: Thu Sep 15 12:50:19 2011
New Revision: 139805
URL: http://llvm.org/viewvc/llvm-project?rev=139805&view=rev
Log:
Thread safety: cleaning up FIXME for trylocks
Modified:
cfe/trunk/include/clang/Basic/Attr.td
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
Modified: cfe/trunk/include/clang/Basic/Attr.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=139805&r1=139804&r2=139805&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Attr.td (original)
+++ cfe/trunk/include/clang/Basic/Attr.td Thu Sep 15 12:50:19 2011
@@ -602,15 +602,19 @@
let LateParsed = 1;
}
+// The first argument is an integer or boolean value specifying the return value
+// of a successful lock acquisition.
def ExclusiveTrylockFunction : InheritableAttr {
let Spellings = ["exclusive_trylock_function"];
- let Args = [VariadicExprArgument<"Args">];
+ let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">];
let LateParsed = 1;
}
+// The first argument is an integer or boolean value specifying the return value
+// of a successful lock acquisition.
def SharedTrylockFunction : InheritableAttr {
let Spellings = ["shared_trylock_function"];
- let Args = [VariadicExprArgument<"Args">];
+ let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">];
let LateParsed = 1;
}
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=139805&r1=139804&r2=139805&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Thu Sep 15 12:50:19 2011
@@ -540,23 +540,23 @@
}
SmallVector<Expr*, 2> Args;
- Args.push_back(Attr.getArg(0)); //FIXME
// check that all arguments are lockable objects
if (!checkAttrArgsAreLockableObjs(S, D, Attr, Args, 1))
return;
unsigned Size = Args.size();
- assert(Size == Attr.getNumArgs());
Expr **StartArg = Size == 0 ? 0 : &Args[0];
if (exclusive)
D->addAttr(::new (S.Context) ExclusiveTrylockFunctionAttr(Attr.getRange(),
S.Context,
+ Attr.getArg(0),
StartArg, Size));
else
D->addAttr(::new (S.Context) SharedTrylockFunctionAttr(Attr.getRange(),
- S.Context, StartArg,
- Size));
+ S.Context,
+ Attr.getArg(0),
+ StartArg, Size));
}
static void handleLocksRequiredAttr(Sema &S, Decl *D, const AttributeList &Attr,
More information about the cfe-commits
mailing list