Project stage-3 (testing & reflection)
Introduction In this blog, we will test and validate the prune-clones I made last time. In this process, I will explain how I modified the files passes.cc and passes.def, and why I made prune_clones.h separately because prune_clones.cc was not enough. passes.cc and passes.def modification process 1. Modify passes.cc The passes.cc file defines and implements several optimization passes for GCC, where you might want to add a prune-clones pass: Define and implement prune_clones related classes and functions. Clearly define what role this path plays in the overall optimization process of the compiler. For example, passes.cc needs to declare a prune_clones class and add code to register it with pass_manager. passes.cc 's main task is to initialize and manage each optimization pass. // passes.cc #include "gcc.h" ... #include "prune_clones.h" // function generating prune_clones pass gimple_opt_pass * make_pass_prune_clones (gcc::context *ctxt ) { retur...