#include <stdio.h>
#include <ext/hash_set>
#include "pinapa-tree.h"
#include "pinapa-tree-utils.h"
#include "input.h"
#include "pinapa-decoration.h"
#include "pinapa-simcontext.h"
#include "pinapa-analyze-body.h"
#include "pinapa-tree-decoration.h"
#include "tree-inline.h"
Namespaces | |
| namespace | pinapa |
Typedefs | |
| typedef hash_set< tree > | pinapa::function_set_t |
Functions | |
| tree | pinapa_initialize_decoration (tree *t, int *x, void *y) |
| 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) |
Variables | |
| function_set_t | pinapa::global_function_set |
| tree | pinapa::current_function |
| tree | pinapa::pinapa_current_function_return_value |
| bool | pinapa::named_return_value_attach_it = false |
| bool | improved_ascii_progress_bar = false |
This file contains the function sc_analyze_function, which is called after GCC's front-end.
| 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.
Initializes the decoration for the top level node of the tree t. Other params are here to be compliant with the type walk_tree_fn, from GCC
| 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 :
| bool improved_ascii_progress_bar = false |