Project Stage 2: Clone-Pruning Analysis Pass
Revamping the GCC Pass for Function Clones In my first project, I created a tool (called a "GCC pass") that worked on two types of computer systems (x86-64 and AARCH64). This tool could print the names of functions (pieces of code that do specific tasks) and count how many "blocks" (sections of code) each function had. However, I wanted to improve it in my second project to do something more advanced — specifically, to detect when a function is a copy of another one (a "cloned" function). Here's how I went about improving this tool. Making Changes to the Tool The first thing I did was teach the tool how to detect a cloned function. When the tool detects one, it stops checking further because I only need to work with one cloned function at a time for now. I also decided to temporarily skip counting the statements and blocks of code, since I will come back to that later when comparing cloned functions. Writing the Updated Code I started by writing the up...