Project Stage 1
In this project, I set out to create a custom GCC pass that analyzed GIMPLE files by iterating through every function, counting the basic blocks, and tallying the number of GIMPLE statements. I successfully integrated this pass into the GCC build system and tested it on a simple C program. Here’s how I did it. 1. Writing the Pass Code I began by writing the pass code in C++ and saved it in a file named tree-my-new-pass.cc within the gcc subdirectory of my GCC source. My pass, which I named "my_new_pass", was designed to run during the GIMPLE phase. The code looked like this: #include "config.h" #include "system.h" #include "coretypes.h" #include "backend.h" #include "tree-pass.h" #include "pass_manager.h" #include "context.h" #include "diagnostic-core.h" #include "tree.h" #include "tree-core.h" #include "basic-block.h" #include "gimple.h" #include "gimp...