gcc/ChangeLog: * tree-pass.h (struct pass_data): Add fields "classname", "filename", "line_num". (PASS_DATA_INIT): New macro. --- gcc/tree-pass.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 4545556..6ebae66 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -61,8 +61,35 @@ struct pass_data /* Flags indicating common sets things to do before and after. */ unsigned int todo_flags_start; unsigned int todo_flags_finish; + + /* Fields intended to make it easier to locate the implementation of + specific passes within gcc's sources. */ + + /* Name of the opt_pass subclass. */ + const char *classname; + + /* Source location of this pass_data instance. */ + const char *filename; + int line_num; }; +/* A macro for initializing instances of struct pass_data, + supplying __FILE__ and __LINE__. */ + +#define PASS_DATA_INIT(TYPE, NAME, OPTINFO_FLAGS, TV_ID, \ + PROPERTIES_REQUIRED, \ + PROPERTIES_PROVIDED, \ + PROPERTIES_DESTROYED, \ + TODO_FLAGS_START, TODO_FLAGS_FINISH, \ + CLASSNAME) \ + { (TYPE), (NAME), (OPTINFO_FLAGS), (TV_ID), \ + (PROPERTIES_REQUIRED), \ + (PROPERTIES_PROVIDED), \ + (PROPERTIES_DESTROYED), \ + (TODO_FLAGS_START), (TODO_FLAGS_FINISH), \ + (CLASSNAME), \ + (__FILE__), (__LINE__) } + namespace gcc { class context; -- 1.8.5.3