[cfe-dev] [analyzer] Rough sketch of the algorithm for "Enhancing bug reporting with static backward program slicing"

Kristóf Umann via cfe-dev cfe-dev at lists.llvm.org
Wed May 22 16:11:08 PDT 2019


Hi!

I'd like to share some thoughts about my GSoC project, "Enhancing bug
reporting with static backward program slicing"[1].

My proposal is very specific about what I'm aiming to improve on, but vague
on the how part of it. This mail aims to add clarify some of this.

Program slicing is essentially a technique of discovering data and control
dependencies to the slicing criterion, which is a (statement, {set of
variables}) pair. Fortunately, tools for control dependencies, namely,
dominator set calculations are already implemented, but seems to be
unstable with clang's CFG. It would be a great tool if I were able to fix
it.

While my proposal states that I plan to implement an AST-based solution,
I'm actually not sure that this is the optimal approach. We could instead
inspect CFG blocks in a backwards manner (coupled with the analyzer's call
stack), and gather relevant variable in the meanwhile.

What would also be really great is to assist this traversal with the
information the analyzer already has, essentially only inspecting basic
blocks the analyzer actually visits.

Here’s my idea for an algorithm (from the point of the slicing criterion
already being constructed):


https://docs.google.com/document/d/1Lx867o3meyQsj0WKOSWMdosSBdw2MUq1aIxyPJM6iLU/edit?usp=sharing


Please note that this is a veeery rough sketch, I didn't think about every
edge case that exists, but I think it's an okay start.


[1]
https://docs.google.com/document/d/1ci1BCAKojPlqIxIw1J_K2dnATA3z01PuwR_vHJS55TI/edit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190523/e3d5022f/attachment.html>


More information about the cfe-dev mailing list