зеркало из https://github.com/microsoft/clang-1.git
Thread safety: cleaning up FIXME for trylocks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139805 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
cb96751b25
Коммит
69f5d14bae
|
@ -602,15 +602,19 @@ def SharedLockFunction : InheritableAttr {
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -540,23 +540,23 @@ static void handleTrylockFunAttr(Sema &S, Decl *D, const AttributeList &Attr,
|
|||
}
|
||||
|
||||
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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче