Skip to content
/ slicer Public

Slicing tool for c++ programs using clang AST.

Notifications You must be signed in to change notification settings

dwat3r/slicer

Repository files navigation

Slicing:

Tasks need to be done:

  • make matcher either for every type of node which is using a variable, or a generalized one.
  • handle continue and break statements in a loop, regarding data dependence
  • correct the data dependence builder algorithm when dealing with nested CompoundStatements in a loop
  • add more tests

Aspects of performance:

  • what should be stored
  • how should it be stored (maybe JSON)

Program structure:

  • Get source file, and line no.
  • Parse AST via ASTMatchers and create the Statement graph.
  • Insert data dependence edges to it.
  • Compute slice regarding the input line no via a breadth-first search.
  • Print (prettily) the slice. (currently it's a GraphViz dot dump.)

Setup:

  1. Download and build the x64 version of llvm and clang for Windows (Visual Studio) @ https://clang.llvm.org/get_started.html using cmake -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD=X86 -G "Visual Studio 16 2019" -A x64 -Thost=x64 ..\llvm (if 16 doesn't work, try a different constant depending on your version of VS, e.g. 15 or 17).
  2. Launch LLVM.sln generated by the command above in VS and build the subgroup Clang libraries.
  3. Launch slicer.sln and open the project Properties. Scan all compiler and linker options for absolute paths and change them according to your layout, namely the LLVM/Clang build folder path.

About

Slicing tool for c++ programs using clang AST.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published