diff options
Diffstat (limited to 'gcc/type-walker.hpp')
-rw-r--r-- | gcc/type-walker.hpp | 113 |
1 files changed, 32 insertions, 81 deletions
diff --git a/gcc/type-walker.hpp b/gcc/type-walker.hpp index 2484843d135..1849b601bd4 100644 --- a/gcc/type-walker.hpp +++ b/gcc/type-walker.hpp @@ -13,87 +13,38 @@ protected: private: tset_t tset; - void _walk(const_tree t, tset_t &tset); - void _walk_wrapper(const_tree t, tset_t &tset); - void _walk_record_or_union(const_tree t, tset_t &tset); - void _walk_function_or_method(const_tree t, tset_t &tset); - virtual bool is_memoized(const_tree t) { return false; }; + void _walk(const_tree t); + void _walk_wrapper(const_tree t); + void _walk_record_or_union(const_tree t); + void _walk_function_or_method(const_tree t); + virtual bool is_memoized(__attribute__((unused))const_tree t) { return false; }; - virtual void _walk_void_pre(const_tree t) {}; - void walk_void(const_tree t, tset_t &tset); - void _walk_void(const_tree t, tset_t &tset); - virtual void _walk_void_post(const_tree t) {}; - virtual void _walk_integer_pre(const_tree t) {}; - void walk_integer(const_tree t, tset_t &tset); - void _walk_integer(const_tree t, tset_t &tset); - virtual void _walk_integer_post(const_tree t) {}; - virtual void _walk_real_pre(const_tree t) {}; - void walk_real(const_tree t, tset_t &tset); - void _walk_real(const_tree t, tset_t &tset); - virtual void _walk_real_post(const_tree t) {}; - virtual void _walk_fixed_point_pre(const_tree t) {}; - void walk_fixed_point(const_tree t, tset_t &tset); - void _walk_fixed_point(const_tree t, tset_t &tset); - virtual void _walk_fixed_point_post(const_tree t) {}; - virtual void _walk_complex_pre(const_tree t) {}; - void _walk_complex(const_tree t, tset_t &tset); - void walk_complex(const_tree t, tset_t &tset); - virtual void _walk_complex_post(const_tree t) {}; - virtual void _walk_enumeral_pre(const_tree t) {}; - void walk_enumeral(const_tree t, tset_t &tset); - void _walk_enumeral(const_tree t, tset_t &tset); - virtual void _walk_enumeral_post(const_tree t) {}; - virtual void _walk_boolean_pre(const_tree t) {}; - void walk_boolean(const_tree t, tset_t &tset); - void _walk_boolean(const_tree t, tset_t &tset); - virtual void _walk_boolean_post(const_tree t) {}; - virtual void _walk_offset_pre(const_tree t) {}; - void walk_offset(const_tree t, tset_t &tset); - void _walk_offset(const_tree t, tset_t &tset); - virtual void _walk_offset_post(const_tree t) {}; - virtual void _walk_record_pre(const_tree t) {}; - void walk_record(const_tree t, tset_t &tset); - void _walk_record(const_tree t, tset_t &tset); - virtual void _walk_record_post(const_tree t) {}; - virtual void _walk_pointer_pre(const_tree t) {}; - void walk_pointer(const_tree t, tset_t &tset); - void _walk_pointer(const_tree t, tset_t &tset); - virtual void _walk_pointer_post(const_tree t) {}; - virtual void _walk_reference_pre(const_tree t) {}; - void walk_reference(const_tree t, tset_t &tset); - void _walk_reference(const_tree t, tset_t &tset); - virtual void _walk_reference_post(const_tree t) {}; - virtual void _walk_array_pre(const_tree t) {}; - void walk_array(const_tree t, tset_t &tset); - void _walk_array(const_tree t, tset_t &tset); - virtual void _walk_array_post(const_tree t) {}; - virtual void _walk_union_pre(const_tree t) {}; - void walk_union(const_tree t, tset_t &tset); - void _walk_union(const_tree t, tset_t &tset); - virtual void _walk_union_post(const_tree t) {}; - virtual void _walk_field_pre(const_tree) {}; - void walk_field(const_tree t, tset_t &tset); - void _walk_field(const_tree t, tset_t &tset); - virtual void _walk_field_post(const_tree t) {}; - virtual void _walk_return_pre(const_tree t) {}; - void walk_return(const_tree, tset_t &tset); - void _walk_return(const_tree, tset_t &tset); - virtual void _walk_return_post(const_tree t) {}; - virtual void _walk_args_pre(const_tree t) {}; - void walk_args(const_tree t, tset_t &tset); - void _walk_args(const_tree t, tset_t &tset); - virtual void _walk_args_post(const_tree t) {}; - virtual void _walk_arg_pre(const_tree t) {}; - void walk_arg(const_tree t, tset_t &tset); - void _walk_arg(const_tree t, tset_t &tset); - virtual void _walk_arg_post(const_tree t) {}; - virtual void _walk_function_pre(const_tree t) {}; - void walk_function(const_tree t, tset_t &tset); - void _walk_function(const_tree t, tset_t &tset); - virtual void _walk_function_post(const_tree t) {}; - virtual void _walk_method_pre(const_tree t) {}; - void walk_method(const_tree t, tset_t &tset); - void _walk_method(const_tree t, tset_t &tset); - virtual void _walk_method_post(const_tree t) {}; +#define TypeWalkerFuncDecl(code) \ + virtual void _walk_ ## code ## _pre(__attribute__((unused)) const_tree t) {}; \ + void walk_ ## code (const_tree t); \ + virtual void _walk_ ## code (const_tree t); \ + virtual void _walk_ ## code ## _post(__attribute__((unused)) const_tree t) {} + + TypeWalkerFuncDecl(VOID_TYPE); + TypeWalkerFuncDecl(INTEGER_TYPE); + TypeWalkerFuncDecl(REAL_TYPE); + TypeWalkerFuncDecl(FIXED_POINT_TYPE); + TypeWalkerFuncDecl(COMPLEX_TYPE); + TypeWalkerFuncDecl(ENUMERAL_TYPE); + TypeWalkerFuncDecl(BOOLEAN_TYPE); + TypeWalkerFuncDecl(OFFSET_TYPE); + TypeWalkerFuncDecl(RECORD_TYPE); + TypeWalkerFuncDecl(POINTER_TYPE); + TypeWalkerFuncDecl(REFERENCE_TYPE); + TypeWalkerFuncDecl(ARRAY_TYPE); + TypeWalkerFuncDecl(UNION_TYPE); + TypeWalkerFuncDecl(FUNCTION_TYPE); + TypeWalkerFuncDecl(METHOD_TYPE); + + // These are not types... + TypeWalkerFuncDecl(field); + TypeWalkerFuncDecl(return); + TypeWalkerFuncDecl(args); + TypeWalkerFuncDecl(arg); }; |