This revision was automatically updated to reflect the committed changes.
tbaeder marked an inline comment as done.
Closed by commit rGcf8e189a99f9: [clang][TSA] Thread safety cleanup functions
(authored by tbaeder).
Changed prior to commit:
https://reviews.llvm.org/D152504?vs=556838&id=557042#
aaronpuchert added inline comments.
Comment at: clang/test/Sema/warn-thread-safety-analysis.c:26
+
// Define the mutex struct.
Oh, I wouldn't mind if you were to drop this spurious added newline. But you
can do this when committing, no need for a new patch se
aaronpuchert accepted this revision.
aaronpuchert added a comment.
Thanks, looks good! I'd like to hear from @aaron.ballman if this warrants a
release note, but that can be added separately.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152504/new/
https://reviews.llvm.org/D152504
___
tbaeder updated this revision to Diff 556838.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152504/new/
https://reviews.llvm.org/D152504
Files:
clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h
clang/lib/Analysis/ThreadSafety.cpp
clang/lib/Analysis/ThreadSafetyCommon.cpp
aaronpuchert added a comment.
Side note: I hope you've seen the failing test
`Analysis/scopes-cfg-output.cpp`, but since that belongs to the predecessor
change I assume it's an issue there.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152504/new/
https://reviews.llvm.org/D152504
___
aaronpuchert accepted this revision.
aaronpuchert added inline comments.
This revision is now accepted and ready to land.
Comment at: clang/lib/Analysis/ThreadSafety.cpp:1776
/// \param D The callee declaration.
/// \param Self If \p Exp = nullptr, the implicit this argume
tbaeder updated this revision to Diff 556535.
tbaeder marked 3 inline comments as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152504/new/
https://reviews.llvm.org/D152504
Files:
clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h
clang/lib/Analysis/ThreadSafety.cpp
c
aaronpuchert added inline comments.
Comment at: clang/lib/Analysis/ThreadSafetyCommon.cpp:320
// Substitute call arguments for references to function parameters
-assert(I < Ctx->NumArgs);
-return translate(Ctx->FunArgs[I], Ctx->Prev);
+if (const a
tbaeder updated this revision to Diff 556399.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152504/new/
https://reviews.llvm.org/D152504
Files:
clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h
clang/lib/Analysis/ThreadSafety.cpp
clang/lib/Analysis/ThreadSafetyCommon.cpp
aaronpuchert added a comment.
Sorry that it took so long, I had to debug it and think a bit. This should do
it:
diff --git a/clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h
b/clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h
index 9d28325c1ea6..13e37ac2b56b 100644
---
tbaeder abandoned this revision.
tbaeder added a comment.
I split out the CFG parts as https://reviews.llvm.org/D152504
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152504/new/
https://reviews.llvm.org/D152504
___
cfe-commits mailing list
cf
tbaeder added a comment.
Ping
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152504/new/
https://reviews.llvm.org/D152504
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
tbaeder added inline comments.
Comment at: clang/lib/Analysis/ThreadSafety.cpp:2436
+CF.getVarDecl()->getLocation());
+ break;
+}
tbaeder wrote:
> tbaeder wrote:
> > aaronpuchert wrote:
> > > aaronpuchert wrote
tbaeder added inline comments.
Comment at: clang/lib/Analysis/ThreadSafety.cpp:2436
+CF.getVarDecl()->getLocation());
+ break;
+}
tbaeder wrote:
> aaronpuchert wrote:
> > aaronpuchert wrote:
> > > tbaeder wrote
tbaeder added a comment.
Ping
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152504/new/
https://reviews.llvm.org/D152504
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
tbaeder added inline comments.
Comment at: clang/lib/Analysis/ThreadSafety.cpp:2436
+CF.getVarDecl()->getLocation());
+ break;
+}
aaronpuchert wrote:
> aaronpuchert wrote:
> > tbaeder wrote:
> > > This handles
aaronpuchert added inline comments.
Comment at: clang/lib/Analysis/ThreadSafety.cpp:2436
+CF.getVarDecl()->getLocation());
+ break;
+}
aaronpuchert wrote:
> tbaeder wrote:
> > This handles the function call, bu
tbaeder updated this revision to Diff 534982.
tbaeder marked an inline comment as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152504/new/
https://reviews.llvm.org/D152504
Files:
clang/include/clang/Analysis/CFG.h
clang/lib/Analysis/CFG.cpp
clang/lib/Analysis/ThreadSafety.cp
tbaeder marked 2 inline comments as done.
tbaeder added inline comments.
Comment at: clang/test/Sema/warn-thread-safety-analysis.c:76-77
+void cleanup_int(int *unused) __attribute__((release_capability(mu1))) {
+ (void)unused;
+ mutex_exclusive_unlock(&mu1);
aaronpuchert added inline comments.
Comment at: clang/lib/Analysis/ThreadSafety.cpp:2436
+CF.getVarDecl()->getLocation());
+ break;
+}
tbaeder wrote:
> This handles the function call, but without the instance p
tbaeder added a comment.
Added a new element for cleanup functions.
Comment at: clang/lib/Analysis/ThreadSafety.cpp:2436
+CF.getVarDecl()->getLocation());
+ break;
+}
This handles the function call, but witho
tbaeder updated this revision to Diff 533175.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152504/new/
https://reviews.llvm.org/D152504
Files:
clang/include/clang/Analysis/CFG.h
clang/lib/Analysis/CFG.cpp
clang/lib/Analysis/ThreadSafety.cpp
clang/test/Sema/warn-thread-safety-ana
NoQ added inline comments.
Comment at: clang/lib/Analysis/CFG.cpp:1945
+ auto DRE =
+ DeclRefExpr::Create(*Context, {}, {}, VD, false, SourceLocation(),
+ VD->getType(), VK_PRValue);
tbaeder wrote:
> NoQ wrote:
> > Is th
tbaeder added a comment.
Pign
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152504/new/
https://reviews.llvm.org/D152504
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
tbaeder added inline comments.
Comment at: clang/lib/Analysis/CFG.cpp:1945
+ auto DRE =
+ DeclRefExpr::Create(*Context, {}, {}, VD, false, SourceLocation(),
+ VD->getType(), VK_PRValue);
NoQ wrote:
> Is there a way to at
tbaeder updated this revision to Diff 530175.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152504/new/
https://reviews.llvm.org/D152504
Files:
clang/lib/Analysis/CFG.cpp
clang/test/Sema/warn-thread-safety-analysis.c
Index: clang/test/Sema/warn-thread-safety-analysis.c
=
NoQ added a comment.
I think this is the right solution and I'm happy to see it!
We have a few "direct" CFG tests in `test/Analysis/cfg.c` etc.; your patch
doesn't seem to be specific to thread safety analysis so it's probably a good
idea to add a few direct tests.
Comment a
tbaeder created this revision.
tbaeder added reviewers: NoQ, aaron.ballman, krememek, dergachev.a, MikeStump.
Herald added a project: All.
tbaeder requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
When a declaration has a cleanup function att
28 matches
Mail list logo