This revision was automatically updated to reflect the committed changes.
Closed by commit rC343831: Thread safety analysis: Examine constructor
arguments (authored by aaronpuchert, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D52443?vs=167856&id=168414#toc
Repository:
r
delesley accepted this revision.
delesley added inline comments.
This revision is now accepted and ready to land.
Comment at: lib/Analysis/ThreadSafety.cpp:2046
const CXXConstructorDecl *D = Exp->getConstructor();
if (D && D->isCopyConstructor()) {
const Expr* Source =
aaronpuchert marked 2 inline comments as done.
aaronpuchert added a comment.
Since the (remaining) arguments are examined in a separate function, I thought
I'd eliminate the boolean variables in `VisitCallExpr`. Apparently I prefer
control flow over booleans, but if you disagree I can obviously
aaronpuchert updated this revision to Diff 167856.
aaronpuchert marked 4 inline comments as done.
aaronpuchert added a comment.
Moved iterator shifting to VisitCallExpr, eliminated boolean variables, and
minor corrections as suggested in the review. There remains no intended
functional change to
delesley added inline comments.
Comment at: lib/Analysis/ThreadSafety.cpp:2046
const CXXConstructorDecl *D = Exp->getConstructor();
if (D && D->isCopyConstructor()) {
const Expr* Source = Exp->getArg(0);
As a side note, we should probably special-case
delesley added a comment.
This looks good, and resolves an outstanding bug that was on my list. Thanks
for the patch!
Comment at: lib/Analysis/ThreadSafety.cpp:1537
void handleCall(const Expr *Exp, const NamedDecl *D, VarDecl *VD = nullptr);
+ void ExamineCallArguments(c
aaron.ballman added inline comments.
Comment at: lib/Analysis/ThreadSafety.cpp:1970
+ // There can be default arguments, so we stop when one iterator is at end().
+ for (auto Arg = ArgBegin; Param != Params.end() && Arg != ArgEnd;
+ ++Param, ++Arg) {
aaro
aaronpuchert added inline comments.
Comment at: lib/Analysis/ThreadSafety.cpp:1970
+ // There can be default arguments, so we stop when one iterator is at end().
+ for (auto Arg = ArgBegin; Param != Params.end() && Arg != ArgEnd;
+ ++Param, ++Arg) {
aaron
aaron.ballman added a comment.
This generally looks sensible to me.
Comment at: lib/Analysis/ThreadSafety.cpp:1970
+ // There can be default arguments, so we stop when one iterator is at end().
+ for (auto Arg = ArgBegin; Param != Params.end() && Arg != ArgEnd;
+ ++Para
aaronpuchert added a comment.
There is a (technical) merge conflict between this change and
https://reviews.llvm.org/D52395, but that shouldn't be of any concern for the
review. The issues are rather independent. (I think.)
Repository:
rC Clang
https://reviews.llvm.org/D52443
___
aaronpuchert created this revision.
aaronpuchert added reviewers: aaron.ballman, delesley.
Herald added a subscriber: cfe-commits.
Instead of only examining call arguments, we also examine constructor
arguments applying the same rules.
That was an oppurtunity for refactoring the examination proce
11 matches
Mail list logo