This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
ziqingluo-90 marked an inline comment as done.
Closed by commit rG6d861d498de1: [-Wunsafe-buffer-usage] Move the whole
analysis to the end of a translation unit
ziqingluo-90 marked an inline comment as done.
ziqingluo-90 added inline comments.
Comment at: clang/lib/Sema/AnalysisBasedWarnings.cpp:2364
+ Node->getBeginLoc())) {
+ UnsafeBufferUsageReporter R(S);
+ clang::checkUnsafeBufferUsage(Node, R,
NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.
Ok looks great to me now!
Comment at: clang/lib/Sema/AnalysisBasedWarnings.cpp:2364
+ Node->getBeginLoc())) {
+ UnsafeBufferUsageReporter R(S);
+
ziqingluo-90 updated this revision to Diff 521409.
ziqingluo-90 added a comment.
Address comments: refactor the callable-definition visitor to take a lambda
Callback, who calls various analyses that need whole-TU information.If one
needs to add a new such analysis later, just add a call
NoQ added inline comments.
Comment at: clang/lib/Sema/AnalysisBasedWarnings.cpp:2340
+ if (Node->doesThisDeclarationHaveABody())
+checkUnsafeBufferUsage(Node);
+ return true;
This code will grow bigger when more warnings are added, and it's
ziqingluo-90 updated this revision to Diff 521184.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146342/new/
https://reviews.llvm.org/D146342
Files:
clang/include/clang/Sema/AnalysisBasedWarnings.h
clang/lib/Sema/AnalysisBasedWarnings.cpp
clang/lib/Sema/Sema.cpp
ziqingluo-90 updated this revision to Diff 521177.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146342/new/
https://reviews.llvm.org/D146342
Files:
clang/include/clang/Sema/AnalysisBasedWarnings.h
clang/lib/Sema/AnalysisBasedWarnings.cpp
clang/lib/Sema/Sema.cpp
ziqingluo-90 updated this revision to Diff 521176.
ziqingluo-90 added a comment.
Clean up the code for early return in case of ignoring `unsafe_buffer_usage`
warnings.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146342/new/
https://reviews.llvm.org/D146342
Files:
ziqingluo-90 updated this revision to Diff 520859.
ziqingluo-90 added a comment.
Visit `LambdaExpr` properly
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146342/new/
https://reviews.llvm.org/D146342
Files:
clang/include/clang/Sema/AnalysisBasedWarnings.h
ziqingluo-90 updated this revision to Diff 519958.
ziqingluo-90 marked an inline comment as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146342/new/
https://reviews.llvm.org/D146342
Files:
clang/include/clang/Sema/AnalysisBasedWarnings.h
ziqingluo-90 marked an inline comment as done.
ziqingluo-90 added inline comments.
Comment at: clang/lib/Sema/AnalysisBasedWarnings.cpp:2363-2364
+ if (isa(Node)) {
+// to visit implicit children of `LambdaExpr`s:
+IsVisitingLambda = true;
+
ziqingluo-90 added inline comments.
Comment at: clang/lib/Sema/AnalysisBasedWarnings.cpp:2335
+ // To analyze callables:
+ if (isa(Node)) {
+// For code in dependent contexts, we'll do this at instantiation time:
NoQ wrote:
> The intended way
ziqingluo-90 updated this revision to Diff 519719.
ziqingluo-90 marked 3 inline comments as done.
ziqingluo-90 added a comment.
Addressed the comments:
- 1) about using a more traditional way of AST traversal; and
- 2) about the concern on `ObjcMethodDecl` traversal.
CHANGES SINCE LAST ACTION
NoQ added inline comments.
Comment at: clang/lib/Sema/AnalysisBasedWarnings.cpp:2320-2323
+void traverseTU(const TranslationUnitDecl *TU) {
+ for (auto I = TU->decls_begin(); I != TU->decls_end(); ++I)
+TraverseDecl(*I);
+}
ziqingluo-90 updated this revision to Diff 518608.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146342/new/
https://reviews.llvm.org/D146342
Files:
clang/include/clang/Sema/AnalysisBasedWarnings.h
clang/lib/Sema/AnalysisBasedWarnings.cpp
clang/lib/Sema/Sema.cpp
ziqingluo-90 updated this revision to Diff 517413.
ziqingluo-90 added a comment.
Move the traversal framework to `AnalysisBasedWarnings` so that the
`UnsafeBufferUsage` analyzer (as well as other possible analyzers) is still
function based. It is in the same pattern as the original
NoQ added inline comments.
Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:1478
+
+ struct CallableFinderCallback : MatchFinder::MatchCallback {
+UnsafeBufferUsageHandler
I think this entire matcher business can easily live in
17 matches
Mail list logo