Commit bfe0d06b by Dale Johannesen Committed by Dale Johannesen

tree-gimple.c: Move GIMPLE definition...


2004-09-25  Dale Johannesen  <dalej@apple.com>

        * tree-gimple.c:  Move GIMPLE definition...
        * doc/tree-ssa.texi:  here.

From-SVN: r88111
parent 45343b92
2004-09-25 Dale Johannesen <dalej@apple.com>
* tree-gimple.c: Move GIMPLE definition...
* doc/tree-ssa.texi: here.
2004-09-25 Kazu Hirata <kazu@cs.umass.edu> 2004-09-25 Kazu Hirata <kazu@cs.umass.edu>
* tree-vectorizer.c: Fix a comment typo. * tree-vectorizer.c: Fix a comment typo.
......
...@@ -83,7 +83,8 @@ perfectly happy to take it as input and spit out GIMPLE. ...@@ -83,7 +83,8 @@ perfectly happy to take it as input and spit out GIMPLE.
GIMPLE is a simplified subset of GENERIC for use in optimization. The GIMPLE is a simplified subset of GENERIC for use in optimization. The
particular subset chosen (and the name) was heavily influenced by the particular subset chosen (and the name) was heavily influenced by the
SIMPLE IL used by the McCAT compiler project at McGill University, SIMPLE IL used by the McCAT compiler project at McGill University
(@uref{http://www-acaps.cs.mcgill.ca/info/McCAT/McCAT.html}),
though we have made some different choices. For one thing, SIMPLE though we have made some different choices. For one thing, SIMPLE
doesn't support @code{goto}; a production compiler can't afford that doesn't support @code{goto}; a production compiler can't afford that
kind of restriction. kind of restriction.
...@@ -529,105 +530,153 @@ void f() ...@@ -529,105 +530,153 @@ void f()
@cindex Rough GIMPLE Grammar @cindex Rough GIMPLE Grammar
@smallexample @smallexample
function: function : FUNCTION_DECL
FUNCTION_DECL DECL_SAVED_TREE -> compound-stmt
DECL_SAVED_TREE -> block
block: compound-stmt: STATEMENT_LIST
BIND_EXPR members -> stmt
BIND_EXPR_VARS -> DECL chain
BIND_EXPR_BLOCK -> BLOCK stmt : block
BIND_EXPR_BODY | if-stmt
-> compound-stmt | switch-stmt
compound-stmt: | goto-stmt
COMPOUND_EXPR | return-stmt
op0 -> non-compound-stmt | resx-stmt
op1 -> stmt | label-stmt
stmt: compound-stmt | try-stmt
| non-compound-stmt | modify-stmt
non-compound-stmt: | call-stmt
block
| if-stmt block : BIND_EXPR
| switch-stmt BIND_EXPR_VARS -> chain of DECLs
| jump-stmt BIND_EXPR_BLOCK -> BLOCK
| label-stmt BIND_EXPR_BODY -> compound-stmt
| try-stmt
| modify-stmt if-stmt : COND_EXPR
| call-stmt op0 -> condition
if-stmt: op1 -> compound-stmt
COND_EXPR op2 -> compound-stmt
op0 -> condition
op1 -> stmt switch-stmt : SWITCH_EXPR
op2 -> stmt op0 -> val
switch-stmt: op1 -> NULL
SWITCH_EXPR op2 -> TREE_VEC of CASE_LABEL_EXPRs
op0 -> val The CASE_LABEL_EXPRs are sorted by CASE_LOW,
op1 -> NULL_TREE and default is last.
op2 -> TREE_VEC of CASE_LABEL_EXPRs
jump-stmt: goto-stmt : GOTO_EXPR
GOTO_EXPR op0 -> LABEL_DECL | val
op0 -> LABEL_DECL | '*' ID
| RETURN_EXPR return-stmt : RETURN_EXPR
op0 -> modify-stmt op0 -> return-value
| NULL_TREE
label-stmt: return-value : NULL
LABEL_EXPR | RESULT_DECL
op0 -> LABEL_DECL | MODIFY_EXPR
try-stmt: op0 -> RESULT_DECL
TRY_CATCH_EXPR op1 -> lhs
op0 -> stmt
op1 -> handler resx-stmt : RESX_EXPR
| TRY_FINALLY_EXPR
op0 -> stmt label-stmt : LABEL_EXPR
op1 -> stmt op0 -> LABEL_DECL
handler:
catch-seq try-stmt : TRY_CATCH_EXPR
| EH_FILTER_EXPR op0 -> compound-stmt
| stmt op1 -> handler
catch-seq: | TRY_FINALLY_EXPR
CATCH_EXPR op0 -> compound-stmt
| COMPOUND_EXPR op1 -> compound-stmt
op0 -> CATCH_EXPR
op1 -> catch-seq handler : catch-seq
modify-stmt: | EH_FILTER_EXPR
MODIFY_EXPR | compound-stmt
op0 -> lhs
op1 -> rhs catch-seq : STATEMENT_LIST
call-stmt: CALL_EXPR members -> CATCH_EXPR
op0 -> _DECL | '&' _DECL
op1 -> arglist modify-stmt : MODIFY_EXPR
arglist: op0 -> lhs
NULL_TREE op1 -> rhs
| TREE_LIST
op0 -> val call-stmt : CALL_EXPR
op1 -> arglist op0 -> val | OBJ_TYPE_REF
op1 -> call-arg-list
varname : compref | _DECL
lhs: varname | '*' _DECL call-arg-list: TREE_LIST
pseudo-lval: _DECL | '*' _DECL members -> lhs | CONST
compref :
COMPONENT_REF addr-expr-arg: ID
op0 -> compref | pseudo-lval | compref
| ARRAY_REF
op0 -> compref | pseudo-lval addressable : addr-expr-arg
op1 -> val | indirectref
condition : val | val relop val with-size-arg: addressable
val : _DECL | CONST | call-stmt
rhs: varname | CONST indirectref : INDIRECT_REF
| '*' _DECL op0 -> val
| '&' varname
| call_expr lhs : addressable
| unop val | bitfieldref
| val binop val | WITH_SIZE_EXPR
| '(' cast ')' val op0 -> with-size-arg
op1 -> val
unop: '+' | '-' | '!' | '~'
min-lval : ID
binop: relop | '-' | '+' | '/' | '*' | indirectref
| '%' | '&' | '|' | '<<' | '>>' | '^'
bitfieldref : BIT_FIELD_REF
relop: All tree codes of class '<' op0 -> inner-compref
op1 -> CONST
op2 -> var
compref : inner-compref
| REALPART_EXPR
op0 -> inner-compref
| IMAGPART_EXPR
op0 -> inner-compref
inner-compref: min-lval
| COMPONENT_REF
op0 -> inner-compref
op1 -> FIELD_DECL
op2 -> val
| ARRAY_REF
op0 -> inner-compref
op1 -> val
op2 -> val
op3 -> val
| ARRAY_RANGE_REF
op0 -> inner-compref
op1 -> val
op2 -> val
op3 -> val
| VIEW_CONVERT_EXPR
op0 -> inner-compref
condition : val
| RELOP
op0 -> val
op1 -> val
val : ID
| CONST
rhs : lhs
| CONST
| call-stmt
| ADDR_EXPR
op0 -> addr-expr-arg
| UNOP
op0 -> val
| BINOP
op0 -> val
op1 -> val
| RELOP
op0 -> val
op1 -> val
@end smallexample @end smallexample
@node Annotations @node Annotations
......
...@@ -33,160 +33,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -33,160 +33,7 @@ Boston, MA 02111-1307, USA. */
#include "expr.h" #include "expr.h"
#include "bitmap.h" #include "bitmap.h"
/* GCC GIMPLE structure /* For the definitive definition of GIMPLE, see doc/tree-ssa.texi. */
Inspired by the SIMPLE C grammar at
http://www-acaps.cs.mcgill.ca/info/McCAT/McCAT.html
function : FUNCTION_DECL
DECL_SAVED_TREE -> compound-stmt
compound-stmt: STATEMENT_LIST
members -> stmt
stmt : block
| if-stmt
| switch-stmt
| goto-stmt
| return-stmt
| resx-stmt
| label-stmt
| try-stmt
| modify-stmt
| call-stmt
block : BIND_EXPR
BIND_EXPR_VARS -> chain of DECLs
BIND_EXPR_BLOCK -> BLOCK
BIND_EXPR_BODY -> compound-stmt
if-stmt : COND_EXPR
op0 -> condition
op1 -> compound-stmt
op2 -> compound-stmt
switch-stmt : SWITCH_EXPR
op0 -> val
op1 -> NULL
op2 -> TREE_VEC of CASE_LABEL_EXPRs
The CASE_LABEL_EXPRs are sorted by CASE_LOW,
and default is last.
goto-stmt : GOTO_EXPR
op0 -> LABEL_DECL | val
return-stmt : RETURN_EXPR
op0 -> return-value
return-value : NULL
| RESULT_DECL
| MODIFY_EXPR
op0 -> RESULT_DECL
op1 -> lhs
resx-stmt : RESX_EXPR
label-stmt : LABEL_EXPR
op0 -> LABEL_DECL
try-stmt : TRY_CATCH_EXPR
op0 -> compound-stmt
op1 -> handler
| TRY_FINALLY_EXPR
op0 -> compound-stmt
op1 -> compound-stmt
handler : catch-seq
| EH_FILTER_EXPR
| compound-stmt
catch-seq : STATEMENT_LIST
members -> CATCH_EXPR
modify-stmt : MODIFY_EXPR
op0 -> lhs
op1 -> rhs
call-stmt : CALL_EXPR
op0 -> val | OBJ_TYPE_REF
op1 -> call-arg-list
call-arg-list: TREE_LIST
members -> lhs
addr-expr-arg: ID
| compref
addressable : addr-expr-arg
| indirectref
with-size-arg: addressable
| call-stmt
indirectref : INDIRECT_REF
op0 -> val
lhs : addressable
| bitfieldref
| WITH_SIZE_EXPR
op0 -> with-size-arg
op1 -> val
min-lval : ID
| indirectref
bitfieldref : BIT_FIELD_REF
op0 -> inner-compref
op1 -> CONST
op2 -> var
compref : inner-compref
| REALPART_EXPR
op0 -> inner-compref
| IMAGPART_EXPR
op0 -> inner-compref
inner-compref: min-lval
| COMPONENT_REF
op0 -> inner-compref
op1 -> FIELD_DECL
op2 -> val
| ARRAY_REF
op0 -> inner-compref
op1 -> val
op2 -> val
op3 -> val
| ARRAY_RANGE_REF
op0 -> inner-compref
op1 -> val
op2 -> val
op3 -> val
| VIEW_CONVERT_EXPR
op0 -> inner-compref
condition : val
| RELOP
op0 -> val
op1 -> val
val : ID
| CONST
rhs : lhs
| CONST
| call-stmt
| ADDR_EXPR
op0 -> addr-expr-arg
| UNOP
op0 -> val
| BINOP
op0 -> val
op1 -> val
| RELOP
op0 -> val
op1 -> val
*/
static inline bool is_gimple_id (tree); static inline bool is_gimple_id (tree);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment