This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Status of Ada in GCC?
Hi,
On Tue, Sep 24, 2002 at 07:24:50PM +0200, Steven Bosscher wrote:
>
> Do you have a formal gramamr, or new-il.[ch] or stuff like that?
You're right, an interface for building GIMPLE trees could be the
first step towards fixing the definition of this IR.
We already have such an interface for building trees, but this
interface seems to be front-end specific (C and C++ define slightly
the same set of build_* functions whenever their semantics differ).
This interface is directly used by the parsers for tree construction.
There are 2 different ways to obtain SIMPLE (or GIMPLE) trees: either
by simplification, or by translation:
- simplify is a lowering. From a tree we get another tree "simpler"
to analyze. Since SIMPLE is a subset of the first language, if you pass
a SIMPLE function to the simplifier, then you get exactly the same
function, and that without creating any new node.
- building SIMPLE trees is a translation since we construct a new copy of
the information and destroy the old representation at the end of this process.
We've choosen the simplifier point of view that is faster and less greedy
in memory for the C/C++ compilers that work on GCC-trees.
However for g95 as for other front-end that use other ASTs a translation
would be necessary, and thus we'll need a GIMPLE building interface.
Sebastian
PS: Here is a list of build_* functions. Some of the functions are
C/C++ specific since they are used directly by parsers. However this list
could serve for starting the GIMPLE building interface.
----
>From gcc/c-typeck.c
tree
build_external_ref (id, fun)
tree id;
int fun;
tree
build_function_call (function, params)
tree function, params;
tree
parser_build_binary_op (code, arg1, arg2)
enum tree_code code;
tree arg1, arg2;
tree
build_binary_op (code, orig_op0, orig_op1, convert_p)
enum tree_code code;
tree orig_op0, orig_op1;
int convert_p;
tree
build_unary_op (code, xarg, flag)
enum tree_code code;
tree xarg;
int flag;
tree
build_conditional_expr (ifexp, op1, op2)
tree ifexp, op1, op2;
tree
build_compound_expr (list)
tree list;
tree
build_c_cast (type, expr)
tree
build_modify_expr (lhs, modifycode, rhs)
tree lhs, rhs;
enum tree_code modifycode;
tree
build_asm_stmt (cv_qualifier, string, outputs, inputs, clobbers)
tree cv_qualifier;
tree string;
tree outputs;
tree inputs;
tree clobbers;
----
>From gcc/cp/typeck.c
tree
build_modify_expr (lhs, modifycode, rhs)
tree lhs;
enum tree_code modifycode;
tree rhs;
tree
build_class_member_access_expr (tree object, tree member,
tree access_path, bool preserve_reference)
tree
build_ptrmemfunc_access_expr (tree ptrmem, tree member_name)
tree
build_x_indirect_ref (ptr, errorstring)
tree ptr;
const char *errorstring;
tree
build_indirect_ref (ptr, errorstring)
tree ptr;
const char *errorstring;
tree
build_array_ref (array, idx)
tree array, idx;
tree
get_member_function_from_ptrfunc (instance_ptrptr, function)
tree *instance_ptrptr;
tree function;
tree
build_function_call_real (function, params, require_complete, flags)
tree function, params;
int require_complete, flags;
tree
build_function_call (function, params)
tree function, params;
tree
build_x_binary_op (code, arg1, arg2)
enum tree_code code;
tree arg1, arg2;
tree
build_binary_op (code, orig_op0, orig_op1, convert_p)
enum tree_code code;
tree orig_op0, orig_op1;
int convert_p ATTRIBUTE_UNUSED;
tree
build_x_unary_op (code, xarg)
enum tree_code code;
tree xarg;
tree
build_unary_op (code, xarg, noconvert)
enum tree_code code;
tree xarg;
int noconvert;
tree
build_x_conditional_expr (ifexp, op1, op2)
tree ifexp, op1, op2;
tree
build_compound_expr (list)
tree list;
tree
build_static_cast (type, expr)
tree type, expr;
tree
build_reinterpret_cast (type, expr)
tree type, expr;
tree
build_const_cast (type, expr)
tree type, expr;
tree
build_c_cast (type, expr)
tree type, expr;
tree
build_modify_expr (lhs, modifycode, rhs)
tree lhs;
enum tree_code modifycode;
tree rhs;
tree
build_ptrmemfunc (type, pfn, force)
tree type, pfn;
int force;
----
>From gcc/c-semantics.c
tree
build_stmt VPARAMS ((enum tree_code code, ...))
tree
build_return_stmt (expr)
tree
build_break_stmt ()
tree
build_continue_stmt ()
tree
build_case_label (low_value, high_value, label_decl)
tree low_value;
tree high_value;
tree label_decl;
----
>From gcc/tree.c
tree
build_int_2_wide (low, hi)
unsigned HOST_WIDE_INT low;
HOST_WIDE_INT hi;
tree
build_vector (type, vals)
tree type, vals;
tree
build_real (type, d)
tree type;
REAL_VALUE_TYPE d;
tree
build_real_from_int_cst (type, i)
tree type;
tree i;
tree
build_string (len, str)
int len;
const char *str;
tree
build_complex (type, real, imag)
tree type;
tree real, imag;
tree
build_tree_list (parm, value)
tree parm, value;
tree
build VPARAMS ((enum tree_code code, tree tt, ...))
tree
build1 (code, type, node)
enum tree_code code;
tree type;
tree node;
tree
build_nt VPARAMS ((enum tree_code code, ...))
tree
build_decl (code, name, type)
enum tree_code code;
tree name, type;
tree
build_block (vars, tags, subblocks, supercontext, chain)
tree vars, tags ATTRIBUTE_UNUSED, subblocks, supercontext, chain;
tree
build_expr_wfl (node, file, line, col)
tree node;
const char *file;
int line, col;
tree
build_decl_attribute_variant (ddecl, attribute)
tree ddecl, attribute;
tree
build_type_attribute_variant (ttype, attribute)
tree ttype, attribute;
tree
build_qualified_type (type, type_quals)
tree type;
int type_quals;
tree
build_type_copy (type)
tree type;
tree
build_pointer_type (to_type)
tree to_type;
tree
build_reference_type (to_type)
tree to_type;
tree
build_type_no_quals (t)
tree t;
tree
build_index_type (maxval)
tree maxval;
tree
build_range_type (type, lowval, highval)
tree type, lowval, highval;
tree
build_index_2_type (lowval, highval)
tree lowval, highval;
tree
build_array_type (elt_type, index_type)
tree elt_type, index_type;
tree
build_function_type (value_type, arg_types)
tree value_type, arg_types;
tree
build_function_type_list VPARAMS ((tree return_type, ...))
tree
build_method_type (basetype, type)
tree basetype, type;
tree
build_offset_type (basetype, type)
tree basetype, type;
tree
build_complex_type (component_type)
tree component_type;
void
build_common_tree_nodes (signed_char)
int signed_char;
void
build_common_tree_nodes_2 (short_double)
int short_double;