@master{master_2,
author = {Arrhén, Johan and Wiklund, Ruben},
title = {Pointer Analysis for Interactive Programming Environments},
publisher = {Lund University},
year = {2024},
file = {ArrhenWiklund.pdf}
}
Static program analysis is the practice of analyzing a program’s properties and behavior without executing it. It is a fundamental part of the compiler, enabling optimizations and error detection. It is also used in programming tools, such as IDEs, where it can be used for autocompletion and code navigation. Points-to analysis is a static program analysis that finds the set of objects that a pointer may point to during execution of the program. Many other analyses benefit from the result of a points-to analysis when analyzing programs with pointers, but the long execution times limit the use in interactive environments. Many algorithms for points-to analysis exist. In our thesis, we investigate how to speed up the points-to analysis Andersen’s Analysis. We introduce PECKA, a Reference Attribute Grammar based tool. It speeds up the execution time by only analyzing code which can be reached within k steps in the program’s call graph from a selected method. We found that when limiting the distance to three steps in the call graph from a method, PECKA could find 56% of the results with a 5x speedup compared to analyzing the whole program. This enables running points-to analysis in an interactive environment. A limitation of this approach is that information can be missed in excluded methods, preventing use in, e.g., optimizing compilers.