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:
Caitlin Sadowski 2011-09-15 17:50:19 +00:00
Родитель cb96751b25
Коммит 69f5d14bae
2 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -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,