[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-26 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa3f4d17a1a53: [Analyzer] Use note tags to track container begin and and changes (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-25 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. Lovely, thank you! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-25 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 252519. baloghadamsoftware added a comment. Test added. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-25 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:713 + StringRef Name; + if (const auto *DRE = dyn_cast(ContE->IgnoreParenCasts())) { +Name = DRE->getDecl()->getName(); baloghadamsoftware wrote: > NoQ wrote: >

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-24 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:713 + StringRef Name; + if (const auto *DRE = dyn_cast(ContE->IgnoreParenCasts())) { +Name =

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-24 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 252364. baloghadamsoftware added a comment. Updated according to a comment. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-23 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:713 + StringRef Name; + if (const auto *DRE = dyn_cast(ContE->IgnoreParenCasts())) { +Name = DRE->getDecl()->getName(); NoQ wrote: > baloghadamsoftware wrote: >

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-23 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Herald added a subscriber: ASDenysPetrov. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:713 + StringRef Name; + if (const auto *DRE = dyn_cast(ContE->IgnoreParenCasts())) { +Name = DRE->getDecl()->getName();

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-16 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:713 + StringRef Name; + if (const auto *DRE = dyn_cast(ContE->IgnoreParenCasts())) { +Name =

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-16 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:713 + StringRef Name; + if (const auto *DRE = dyn_cast(ContE->IgnoreParenCasts())) { +Name =

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-15 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:713 + StringRef Name; + if (const auto *DRE = dyn_cast(ContE->IgnoreParenCasts())) { +Name = DRE->getDecl()->getName(); Hmm, i think you should instead look at

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-09 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I wonder whether I should change "to/from the left" to "towards/from the front" and "to/from the right" to "towards/from the right"? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 248495. baloghadamsoftware added a comment. Minor style change. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-04 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus accepted this revision. Szelethus added a comment. This revision is now accepted and ready to land. The scope of the patch is small and is well tested. I suggest to move the discussion about debug messages and `NoteTag`s to the next revision. LGTM! CHANGES SINCE LAST ACTION

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-03 Thread Csaba Dabis via Phabricator via cfe-commits
Charusso added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport ) -> std::string { + SmallString<256> Msg; baloghadamsoftware wrote: > Szelethus wrote: > >

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 247856. baloghadamsoftware added a comment. Back to the version where we do not check for interestingness. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files:

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-02 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus requested changes to this revision. Szelethus added a comment. This revision now requires changes to proceed. Apologies -- I'd definitely prefer to address the debug related changes in a separate pack, similarly to D74541 . CHANGES SINCE LAST ACTION

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-02 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. In D73720#1874014 , @baloghadamsoftware wrote: > In case of multiple container-related bugs only mark the container > interesting on the correct bug path. Also a typo fixed. ~~Uh-oh, I'm not sure why this would ever be an

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-14 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 244667. baloghadamsoftware added a comment. Minor update: ignore parentheses and casts when taking the name of the expression. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files:

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-13 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 244380. baloghadamsoftware added a comment. In case of multiple container-related bugs only mark the container interesting on the correct bug path. Also a typo fixed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-12 Thread Nicolás Alvarez via Phabricator via cfe-commits
nicolas17 added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:484 +const NoteTag *ChangeTag = + getChangeTag(C, "shrinked from the right by 1 position", ContReg, ContE); // For vector-like and deque-like containers invalidate

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-12 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus accepted this revision. Szelethus added a comment. This revision is now accepted and ready to land. LGTM, I like everything here, you worded the notes very nicely and the test cases seems to cover everything I could find! Please wait for @NoQ's approval, since he's the ranking member

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-12 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D73720#1871955 , @Szelethus wrote: > Do we have a test where 2 containers are present but only one of them should > be marked as interesting? Yes, of course we have, that was the starting point of the discussion.

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-12 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. Do we have a test where 2 containers are present but only one of them should be marked as interesting? void deref_end_after_pop_back(std::vector , std::vector ) { const auto i = --V.end(); const auto i2 = --V2.end(); V.pop_back(); //

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-11 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 243796. baloghadamsoftware added a comment. First real checker `IteratorRange` now marks container as interesting to benefit from container note tags. The other two iterator checkers will be updated after a second phase of container note tags

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-10 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 4 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport ) -> std::string { + SmallString<256> Msg;

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-10 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 243571. baloghadamsoftware added a comment. Only track the right container. Furthermore, minor updates according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files:

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-07 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport ) -> std::string { + SmallString<256> Msg; baloghadamsoftware wrote: > NoQ wrote: > > Szelethus

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport ) -> std::string { + SmallString<256> Msg;

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-05 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport ) -> std::string { + SmallString<256> Msg; Szelethus wrote: > NoQ wrote: > > baloghadamsoftware wrote: > >

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-05 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added subscribers: steakhal, boga95. Szelethus added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport ) -> std::string { + SmallString<256> Msg; NoQ wrote:

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-04 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport ) -> std::string { + SmallString<256> Msg; baloghadamsoftware wrote: > NoQ wrote: > > You'll need to check

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 242323. baloghadamsoftware added a comment. `const SVal &` -> `SVal` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport ) -> std::string { + SmallString<256> Msg;

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. Also, yay, thanks for using the new API! Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:41 const SVal = UndefinedVal()) const; - void handleAssign(CheckerContext , const SVal ) const; - void

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport ) -> std::string { + SmallString<256> Msg; You'll need to check whether the container is actually of

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-01-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun. Container operations such as `push_back()`,