- case iro_Proj:
- {
- type *mt; /* A method type */
- long nr = get_Proj_proj(pred);
-
- pred = skip_Id(get_Proj_pred(pred));
- ASSERT_AND_RET((get_irn_mode(pred) == mode_T), "Proj from something not a tuple", 0);
- switch (get_irn_opcode(pred))
- {
- case iro_Start:
- mt = get_entity_type(get_irg_entity(irg));
-
- if (nr == pn_Start_T_args) {
- ASSERT_AND_RET(
- (proj >= 0 && mode_is_data(mode)),
- "wrong Proj from Proj from Start", 0);
- ASSERT_AND_RET(
- (proj < get_method_n_params(mt)),
- "More Projs for args than args in type", 0
- );
- if ((mode_is_reference(mode)) && is_compound_type(get_method_param_type(mt, proj)))
- /* value argument */ break;
-
- ASSERT_AND_RET(
- (mode == get_type_mode(get_method_param_type(mt, proj))),
- "Mode of Proj from Start doesn't match mode of param type.", 0);
- }
- else if (nr == pn_Start_P_value_arg_base) {
- ASSERT_AND_RET(
- (proj >= 0 && mode_is_reference(mode)),
- "wrong Proj from Proj from Start", 0
- );
- ASSERT_AND_RET(
- (proj < get_method_n_params(mt)),
- "More Projs for args than args in type", 0
- );
- }
- break;
-
- case iro_Call:
- {
- ASSERT_AND_RET(
- (proj >= 0 && mode_is_data(mode)),
- "wrong Proj from Proj from Call", 0);
- mt = get_Call_type(pred);
- ASSERT_AND_RET(
- (proj < get_method_n_ress(mt)),
- "More Projs for results than results in type.", 0);
- if ((mode_is_reference(mode)) && is_compound_type(get_method_res_type(mt, proj)))
- /* value result */ break;
-
- ASSERT_AND_RET(
- (mode == get_type_mode(get_method_res_type(mt, proj))),
- "Mode of Proj from Call doesn't match mode of result type.", 0);
- }
- break;
-
- case iro_FuncCall:
- {
- ASSERT_AND_RET(
- (proj >= 0 && mode_is_data(mode)),
- "wrong Proj from Proj from FuncCall", 0);
- mt = get_FuncCall_type(pred);
- ASSERT_AND_RET(
- (proj < get_method_n_ress(mt)),
- "More Projs for results than results in type.", 0);
- if ((mode_is_reference(mode)) && is_compound_type(get_method_res_type(mt, proj)))
- /* value result */ break;
-
- ASSERT_AND_RET(
- (mode == get_type_mode(get_method_res_type(mt, proj))),
- "Mode of Proj from FuncCall doesn't match mode of result type.", 0);
- }
- break;
+/**
+ * verify a Proj(Store) node
+ */
+static int verify_node_Proj_Store(ir_node *n, ir_node *p) {
+ ir_mode *mode = get_irn_mode(p);
+ long proj = get_Proj_proj(p);
+
+ ASSERT_AND_RET_DBG(
+ ((proj == pn_Store_M && mode == mode_M) ||
+ (proj == pn_Store_X_except && mode == mode_X)),
+ "wrong Proj from Store", 0,
+ show_proj_failure(p);
+ );
+ if (proj == pn_Store_X_except)
+ ASSERT_AND_RET(
+ get_irn_pinned(n) == op_pin_state_pinned,
+ "Exception Proj from unpinned Store", 0);
+ return 1;
+}