call_target = validize_mem (call_target);
}
- call_exp = build (CALL_EXPR, type, func, args, 0);
+ call_exp = build (CALL_EXPR, type, func, args, NULL_TREE);
TREE_SIDE_EFFECTS (call_exp) = 1;
return_target = expand_call (call_exp, call_target, ignore);
if (call_target == 0)
init = maybe_build_cleanup (convert_from_reference (init));
if (init != NULL_TREE)
- expand_expr (init, 0, 0, 0);
+ expand_expr (init, const0_rtx, VOIDmode, 0);
}
call_target = return_target = DECL_RTL (slot);
}
expand_throw (TREE_OPERAND (exp, 0));
return NULL;
- case UNSAVE_EXPR:
- {
- rtx temp;
- temp = expand_expr (TREE_OPERAND (exp, 0), target, tmode, modifier);
- TREE_OPERAND (exp, 0) = unsave_expr_now (TREE_OPERAND (exp, 0));
- return temp;
- }
+ case VEC_INIT_EXPR:
+ return expand_expr
+ (expand_vec_init
+ (NULL_TREE, TREE_OPERAND (exp, 0),
+ build_binary_op (MINUS_EXPR, TREE_OPERAND (exp, 2),
+ integer_one_node, 1),
+ TREE_OPERAND (exp, 1), 0), target, tmode, modifier);
default:
break;
}
}
-/* Return nonzero iff DECL is memory-based. The DECL_RTL of
- certain const variables might be a CONST_INT, or a REG
- in some cases. We cannot use `memory_operand' as a test
- here because on most RISC machines, a variable's address
- is not, by itself, a legitimate address. */
-
-int
-decl_in_memory_p (decl)
- tree decl;
-{
- return DECL_RTL (decl) != 0 && GET_CODE (DECL_RTL (decl)) == MEM;
-}
-
/* Expand this initialization inline and see if it's simple enough that
it can be done at compile-time. */
return 1;
#endif
}
+
+void
+do_case (start, end)
+ tree start, end;
+{
+ tree value1 = NULL_TREE, value2 = NULL_TREE, label;
+
+ if (start != NULL_TREE && TREE_TYPE (start) != NULL_TREE
+ && POINTER_TYPE_P (TREE_TYPE (start)))
+ error ("pointers are not permitted as case values");
+
+ if (end && pedantic)
+ pedwarn ("ANSI C++ forbids range expressions in switch statement");
+
+ if (current_template_parms)
+ {
+ add_tree (build_min_nt (CASE_LABEL, start, end));
+ return;
+ }
+
+ if (start)
+ value1 = check_cp_case_value (start);
+ if (end)
+ value2 = check_cp_case_value (end);
+
+ label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
+
+ if (value1 != error_mark_node
+ && value2 != error_mark_node)
+ {
+ tree duplicate;
+ int success;
+
+ if (end)
+ success = pushcase_range (value1, value2, convert_and_check,
+ label, &duplicate);
+ else if (start)
+ success = pushcase (value1, convert_and_check, label, &duplicate);
+ else
+ success = pushcase (NULL_TREE, 0, label, &duplicate);
+
+ if (success == 1)
+ {
+ if (end)
+ error ("case label not within a switch statement");
+ else if (start)
+ cp_error ("case label `%E' not within a switch statement", start);
+ else
+ error ("default label not within a switch statement");
+ }
+ else if (success == 2)
+ {
+ if (end)
+ {
+ error ("duplicate (or overlapping) case value");
+ cp_error_at ("this is the first entry overlapping that value",
+ duplicate);
+ }
+ else if (start)
+ {
+ cp_error ("duplicate case value `%E'", start);
+ cp_error_at ("previously used here", duplicate);
+ }
+ else
+ {
+ error ("multiple default labels in one switch");
+ cp_error_at ("this is the first default label", duplicate);
+ }
+ }
+ else if (success == 3)
+ warning ("case value out of range");
+ else if (success == 4)
+ warning ("empty range specified");
+ else if (success == 5)
+ {
+ if (end)
+ error ("case label within scope of cleanup or variable array");
+ else
+ cp_error ("case label `%E' within scope of cleanup or variable array", start);
+ }
+ }
+ if (start)
+ define_case_label (label);
+ else
+ define_case_label (NULL_TREE);
+}