diff --git a/src/rap_opt.h b/src/rap_opt.h index 919ca1a..fe504e9 100644 --- a/src/rap_opt.h +++ b/src/rap_opt.h @@ -7,6 +7,18 @@ We supply the API for RAP */ extern int rap_available_naive(tree p, tree func); +/* This function is defined in gcc/c-decl.c */ +extern tree lookup_name(tree); +/* */ +#define I_SYMBOL_BINDING(node) \ + (((struct lang_identifier *) IDENTIFIER_NODE_CHECK(node))->symbol_binding) + +#define RAP_POINTER_TO_FUNCTION(P) + +/* This is defined in gcc/c-decl.c but as static linkage, so we reuse it here. + And the depth of external scope is 0. + If scope depth is more than 1 it's local scope */ +#define FILE_SCOPE_DEPTH 1 #endif /* RAP_OPT_H */ diff --git a/src/rap_opt_pass0.c b/src/rap_opt_pass0.c index e78cc35..0bf9631 100644 --- a/src/rap_opt_pass0.c +++ b/src/rap_opt_pass0.c @@ -2,6 +2,7 @@ We supply the API for RAP */ #include "gcc-common.h" +#include "rap_opt.h" //#include "set.h" @@ -33,7 +34,6 @@ register_callback(plugin_name, PLUGIN_FINISH_UNIT, rap_gather_avail_function, &func_set); -#define RAP_POINTER_TO_FUNCTION(P) /* */