Project stage 2

 For the project's Second stage, I provided a diagnostic output for the proof of concept implementation of the GCC AFMV feature. So, I made a dummy test :

#include "config.h"

#include "system. h"

#include "coretypes.h"

#include "backend.h"

#include "tree-pass.h"

#include "gimple.h"

#include "rtl.h"

#include "tree.h"


namespace {

        const pass_data pass_data_gimple_diagnostic_test =

        {

                GIMPLE_PASS,

                "diagnostic_test", /* name */

                OPTGROUP_VEC, /* optinfo_flags */

                TV_NONE, /* tv_id */

                PROP_cfg, /* properties_required */

                0, /* properties_provided */

                0, /* properties_destroyed */

                0, /* todo_flags_start */

                0, /* todo_flags_finish */

        };


        class pass_gimple_diagnostic_test : public gimple_opt_pass

        {

                public:

                        pass_gimple_diagnostic_test (gcc::context *ctxt) : gimple_opt_pass (pass_data_gimple_diagnostic_test)

                {}


                        bool gate (function *) final override

                        {

                                return true;

                        }


                        unsigned int execute (function *) final override;

        };


        unsigned int pass_gimple_diagnostic_test::execute (struct function *fun)

        {

                fprintf(stderr, "Diagnostic Test\n");

                return 0;

        }

}


gimple_opt_pass * make_pass_gimple_diagnostic_test (gcc::context *ctxt)

{

        return new pass_gimple_diagnostic_test (ctxt);

}


After that, I added the pass to passes.def and tree-pass.h files and tried to rebuild the GCC to see if I could get the GCC compiler to dump the output.


Reflection

When I tried to rebuild the GCC, I ran into an error at the 4 minute mark. The error was regarding a dummy_pass function in tree-pass.h. I did not change that function and was unsure why it was throwing that error. 

Comments

Popular Posts