summaryrefslogtreecommitdiff
path: root/gcc/gimple.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r--gcc/gimple.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h
index ca7fec6247e..e5b594a5b01 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -6494,6 +6494,23 @@ gimple_transaction_set_subcode (gtransaction *transaction_stmt,
transaction_stmt->subcode = subcode;
}
+
+/* Return the return value for GIMPLE_RETURN GS. */
+
+static inline tree
+gimple_return_retval (const greturn *gs)
+{
+ return gs->op[0];
+}
+
+static inline tree
+gimple_return_retval(const gimple *gs)
+{
+ GIMPLE_CHECK(gs, GIMPLE_RETURN);
+ const greturn *gr = dyn_cast<const greturn *> (gs);
+ return gimple_return_retval (gr);
+}
+
/* Return a pointer to the return value for GIMPLE_RETURN GS. */
static inline tree *
@@ -6502,15 +6519,14 @@ gimple_return_retval_ptr (greturn *gs)
return &gs->op[0];
}
-/* Return the return value for GIMPLE_RETURN GS. */
-
-static inline tree
-gimple_return_retval (const greturn *gs)
+static inline tree *
+gimple_return_retval_ptr (gimple *gs)
{
- return gs->op[0];
+ GIMPLE_CHECK(gs, GIMPLE_RETURN);
+ greturn *gr = dyn_cast<greturn *> (gs);
+ return gimple_return_retval_ptr (gr);
}
-
/* Set RETVAL to be the return value for GIMPLE_RETURN GS. */
static inline void