some changes to builtin's calls
[official-gcc.git] / gcc / python / py-tree.h
blob030b7319d4945af36a34f4e417897e2b90b8ee4a
1 /* This file is part of GCC.
3 GCC is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 3, or (at your option)
6 any later version.
8 GCC is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with GCC; see the file COPYING3. If not see
15 <http://www.gnu.org/licenses/>. */
17 #ifndef __PY_TREE_H__
18 #define __PY_TREE_H__
20 extern void gpy_ident_vec_init( gpy_ident_vector_t * const v )
21 __attribute__((nonnull));
23 extern void gpy_ident_vec_push( gpy_ident_vector_t * const v, void * s )
24 __attribute__((nonnull));
26 extern void * gpy_ident_vec_pop( gpy_ident_vector_t * const v )
27 __attribute__((nonnull));
29 extern gpy_hashval_t gpy_dd_hash_string( const char * );
31 extern gpy_hash_entry_t * gpy_dd_hash_lookup_table( gpy_hash_tab_t *, gpy_hashval_t );
33 extern void ** gpy_dd_hash_insert( gpy_hashval_t, void *, gpy_hash_tab_t * );
35 extern void gpy_dd_hash_grow_table( gpy_hash_tab_t * );
37 extern void gpy_dd_hash_init_table( gpy_hash_tab_t ** );
39 extern void gpy_gg_invoke_garbage( void );
41 extern void gpy_garbage_free_obj( gpy_symbol_obj ** );
43 /* expression.c */
44 extern VEC(tree,gc) * gpy_process_assign (gpy_symbol_obj ** , gpy_symbol_obj **,
45 VEC(gpy_ctx_t,gc) *);
47 extern VEC(tree,gc) * gpy_process_bin_expression (gpy_symbol_obj ** , gpy_symbol_obj **,
48 gpy_opcode_t, VEC(gpy_ctx_t,gc) *);
50 extern VEC(tree,gc) * gpy_fold_primitive (const gpy_symbol_obj * const);
52 extern VEC(tree,gc) * gpy_fold_call (tree, location_t);
54 /* ------- */
56 extern VEC(tree,gc) * gpy_process_expression( const gpy_symbol_obj * const, VEC(gpy_ctx_t,gc) * );
58 extern VEC(tree,gc) * gpy_process_class( gpy_symbol_obj * const, VEC(gpy_ctx_t,gc) * );
60 extern VEC(tree,gc) * gpy_process_functor( const gpy_symbol_obj * const, const char *,
61 VEC(gpy_ctx_t,gc) * );
63 extern VEC(tree,gc) * gpy_get_tree( gpy_symbol_obj *, VEC(gpy_ctx_t,gc) * );
65 extern VEC(tree,gc) * gpy_process_print( gpy_symbol_obj *, VEC(gpy_ctx_t,gc) * );
66 /* ------- */
68 extern tree gpy_main_method_decl( VEC(tree,gc) * , gpy_context_branch * );
70 extern tree gpy_ctx_lookup_decl( VEC(gpy_ctx_t,gc) *, const char * );
72 extern void gpy_process_decl( gpy_symbol_obj * );
74 extern bool gpy_ctx_push_decl( tree, const char *, gpy_context_branch * );
76 extern void gpy_symbol_init_ctx( gpy_symbol_obj * const )
77 __attribute__((nonnull));
79 extern void gpy_init_ctx_branch( gpy_context_branch * const * )
80 __attribute__((nonnull));
82 #define GPY_VEC_stmts_append(x,y) \
83 do { \
84 int x_ = 0; tree t_ = NULL_TREE; \
85 for (; VEC_iterate(tree,y,x_,t_); ++x_) \
86 { \
87 VEC_safe_push(tree,gc,x,t_); \
88 } \
89 } while (0); \
91 #endif //__PYPY_TREE_H__