Assignment for GIMPLE Manipulation

Problem statement

  1. Add a pass to the GCC pass list that performs GIMPLE Manipulation for you. In the pass, do the following:

    • - Count the number of local variables in a program.

    • - Count the number of global variables in a program.

    • - Count the number of pointer variables in a program.

Patch Provided

The patch provided implements adding an empty Interprocedural pass to GCC 4.5.0.

Hints

  1. Global variables will obviously be stored in a global data structure. Find the data structure that stores the linked list of global variables.

  2. Local variables will obviously be stored within the function that is being compiled. Which field of the function data structure holds the local variables?