#include "pinapa-parser-all.h"
Go to the source code of this file.
Functions | |
| void | pinapa_gcc_analyze_function_hook (tree fn) |
| void | pinapa_named_return_value_optimisation_hook () |
| void | pinapa_gcc_keep_old_node_hook (tree t, tree arg1) |
| void | pinapa_gcc_build_tree_node_hook (tree t) |
This header file is actually rather useless, but I like to have a header file for each .cc file ...
| void pinapa_gcc_analyze_function_hook | ( | tree | fn | ) |
Function called by GCC's modified front-end.
A call to this function has been added in GCC's source code.
| void pinapa_gcc_build_tree_node_hook | ( | tree | t | ) |
Hook added in tree.c, line 2409
this function helps keeping in mind location in source file of interesting statements (call_expr), since gcc does not retain this information but for _DECL nodes
Hook added in fold-const.c, line 1703.
this is to keep the type of the node as a decoration because the next line will override it with another type.
This is useful to manage enumeral types, since the TREE_TYPE is ENUMERAL_TYPE at this moment, and will be overridden by INTEGER_TYPE.
| void pinapa_named_return_value_optimisation_hook | ( | ) |
There is an optimisation of GCC : When the expression of all the "return" statements of a function are a single variable (only if this is an object.), and if it is always the same variable, then, this variable is stored once for all in a global variable pointed to by the macro current_function_return_value.
see genrtl_start_function, and declare_return_variable in GCC for more details.
The problem for us is that this variable will be overridden when the next function will be parsed.
So, we'll add it to the decoration of the function declaration.
This function has been added as a hook in GCC's source :