aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/TestModuleFileExtension.cpp
diff options
context:
space:
mode:
authorKristóf Umann <dkszelethus@gmail.com>2021-08-19 15:37:02 +0200
committerKristóf Umann <dkszelethus@gmail.com>2021-09-03 13:50:18 +0200
commita375bfb5b729e0f3ca8d5e001f423fa89e74de87 (patch)
tree8c3cfe8e9d78d1edc1db239f2658adb986e78ccb /clang/lib/Frontend/TestModuleFileExtension.cpp
parent718157283c7954e744041a5b04f91037f4a487d6 (diff)
downloadllvm-a375bfb5b729e0f3ca8d5e001f423fa89e74de87.zip
llvm-a375bfb5b729e0f3ca8d5e001f423fa89e74de87.tar.gz
llvm-a375bfb5b729e0f3ca8d5e001f423fa89e74de87.tar.bz2
[analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function calls, rather than each ExplodedNode in it
D105553 added NoStateChangeFuncVisitor, an abstract class to aid in creating notes such as "Returning without writing to 'x'", or "Returning without changing the ownership status of allocated memory". Its clients need to define, among other things, what a change of state is. For code like this: f() { g(); } foo() { f(); h(); } We'd have a path in the ExplodedGraph that looks like this: -- <g> --> / \ --- <f> --------> --- <h> ---> / \ / \ -------- <foo> ------ <foo> --> When we're interested in whether f neglected to change some property, NoStateChangeFuncVisitor asks these questions: ÷×~ -- <g> --> ß / \$ @&#* --- <f> --------> --- <h> ---> / \ / \ -------- <foo> ------ <foo> --> Has anything changed in between # and *? Has anything changed in between & and *? Has anything changed in between @ and *? ... Has anything changed in between $ and *? Has anything changed in between × and ~? Has anything changed in between ÷ and ~? ... Has anything changed in between ß and *? ... This is a rather thorough line of questioning, which is why in D105819, I was only interested in whether state *right before* and *right after* a function call changed, and early returned to the CallEnter location: if (!CurrN->getLocationAs<CallEnter>()) return; Except that I made a typo, and forgot to negate the condition. So, in this patch, I'm fixing that, and under the same hood allow all clients to decide to do this whole-function check instead of the thorough one. Differential Revision: https://reviews.llvm.org/D108695
Diffstat (limited to 'clang/lib/Frontend/TestModuleFileExtension.cpp')
0 files changed, 0 insertions, 0 deletions