gccint: Expression trees
1
1 11.6 Expressions
1 ================
1
1 The internal representation for expressions is for the most part quite
1 straightforward. However, there are a few facts that one must bear in
1 mind. In particular, the expression "tree" is actually a directed
1 acyclic graph. (For example there may be many references to the integer
1 constant zero throughout the source program; many of these will be
1 represented by the same expression node.) You should not rely on
1 certain kinds of node being shared, nor should you rely on certain kinds
1 of nodes being unshared.
1
1 The following macros can be used with all expression nodes:
1
1 'TREE_TYPE'
1 Returns the type of the expression. This value may not be
1 precisely the same type that would be given the expression in the
1 original program.
1
1 In what follows, some nodes that one might expect to always have type
1 'bool' are documented to have either integral or boolean type. At some
1 point in the future, the C front end may also make use of this same
1 intermediate representation, and at this point these nodes will
1 certainly have integral type. The previous sentence is not meant to
1 imply that the C++ front end does not or will not give these nodes
1 integral type.
1
1 Below, we list the various kinds of expression nodes. Except where
1 noted otherwise, the operands to an expression are accessed using the
1 'TREE_OPERAND' macro. For example, to access the first operand to a
1 binary plus expression 'expr', use:
1
1 TREE_OPERAND (expr, 0)
1
1 As this example indicates, the operands are zero-indexed.
1
Menu