Note: The folding of non-omp cases is something to move into
the middle-end. As for now we have most foldings only on GENERIC
in fold-const, we need to perform this before transformation to
- GIMPLE-form. */
+ GIMPLE-form.
+
+ ??? This is algorithmically weird because walk_tree works in pre-order, so
+ we see outer expressions before inner expressions. This isn't as much of an
+ issue because cp_fold recurses into subexpressions in many cases, but then
+ walk_tree walks back into those subexpressions again. We avoid the
+ resulting complexity problem by caching the result of cp_fold, but it's
+ inelegant. */
static tree
cp_fold_r (tree *stmt_p, int *walk_subtrees, void *data_)
/* An OFFSET_REF is used in two situations:
1. An expression of the form `A::m' where `A' is a class and `m' is
- a non-static member. In this case, operand 0 will be a TYPE
- (corresponding to `A') and operand 1 will be a FIELD_DECL,
- BASELINK, or TEMPLATE_ID_EXPR (corresponding to `m').
-
- The expression is a pointer-to-member if its address is taken,
- but simply denotes a member of the object if its address is not
- taken.
+ a non-static member or an overload set. In this case, operand 0
+ will be a TYPE (corresponding to `A') and operand 1 will be a
+ FIELD_DECL, BASELINK, or TEMPLATE_ID_EXPR (corresponding to `m').
+
+ The expression is a pointer-to-member if its address is taken (and
+ if, after any overload resolution, 'm' does not designate a
+ static or explicit object member function). It simply denotes a
+ member of the object if its address is not taken.
This form is only used during the parsing phase; once semantic
analysis has taken place they are eliminated.