ziqingluo-90 added a comment.
This is a lot of work, thank you @t-rasmud & @NoQ !
I have a minor suggestion: can we use some macros to make the debug stub even
shorter?
The prefix `"failed to produce fixit for declaration"` is used in many places
so probably we do not have to repeat it
NoQ added inline comments.
Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:2248-2249
+#ifndef NDEBUG
+// FIXME: F->getBaseStmt() should never be null!
+// (Or we should build a better interface for this.)
+Handler.addDebugNoteForVar(
NoQ added a comment.
Awesome!!
Did you try running it on some real code? Does this actually cover most cases?
(I suspect that (1.) is going to be the most popular case, but that's also the
easiest case to diagnose visually. We might still want a note if we wanted to
prioritize among
t-rasmud updated this revision to Diff 541745.
t-rasmud added a comment.
This patch addresses cases 2, 3, and 4 described in the summary (i.e) adds
debug notes for unclaimed uses of variables and for failed fixit generation of
variable declarations.
CHANGES SINCE LAST ACTION
t-rasmud added a comment.
I will add debug notes for the rest of the cases not addressed in this patch.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154880/new/
https://reviews.llvm.org/D154880
___
cfe-commits mailing list
NoQ updated this revision to Diff 538862.
NoQ added a comment.
Add the other missing base statement. Debugger was acting weirdly so I thought
we had bigger problems, but it's just the other thing missing. It's likely that
we ultimately want a better interface for that anyway.
CHANGES SINCE
NoQ updated this revision to Diff 538852.
NoQ added a comment.
`private:` => `public:`
(for some reason it didn't complain until I did a full rebuild)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154880/new/
https://reviews.llvm.org/D154880
Files:
NoQ added inline comments.
Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:578
- virtual const Stmt *getBaseStmt() const override { return nullptr; }
+ virtual const Stmt *getBaseStmt() const override { return PtrInitRHS; }
I changed this to make
NoQ created this revision.
NoQ added reviewers: jkorous, t-rasmud, ziqingluo-90, malavikasamak.
Herald added subscribers: steakhal, martong.
Herald added a project: All.
NoQ requested review of this revision.
Herald added a subscriber: wangpc.
This patch adds extra notes to