From 981ac3c795ed23053c0a82d01d8d3158429a547f Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 19 Aug 2014 18:24:21 +0000 Subject: [PATCH] Return rtx_insn from get_insns/get_last_insn 2014-08-19 David Malcolm * emit-rtl.h (get_insns): Strengthen return type from rtx to rtx_insn *, adding a checked cast for now. (get_last_insn): Likewise. From-SVN: r214180 --- gcc/ChangeLog | 6 ++++++ gcc/emit-rtl.h | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8c472a8277a5..d86b78b2bc9a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-08-19 David Malcolm + + * emit-rtl.h (get_insns): Strengthen return type from rtx to + rtx_insn *, adding a checked cast for now. + (get_last_insn): Likewise. + 2014-08-19 David Malcolm * rtl.h (gen_label_rtx): Strengthen return type from rtx to diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h index 8439750416b7..e97e0cbfd5c4 100644 --- a/gcc/emit-rtl.h +++ b/gcc/emit-rtl.h @@ -77,10 +77,11 @@ extern bool need_atomic_barrier_p (enum memmodel, bool); /* Return the first insn of the current sequence or current function. */ -static inline rtx +static inline rtx_insn * get_insns (void) { - return crtl->emit.x_first_insn; + rtx insn = crtl->emit.x_first_insn; + return safe_as_a (insn); } /* Specify a new insn as the first in the chain. */ @@ -94,10 +95,11 @@ set_first_insn (rtx insn) /* Return the last insn emitted in current sequence or current function. */ -static inline rtx +static inline rtx_insn * get_last_insn (void) { - return crtl->emit.x_last_insn; + rtx insn = crtl->emit.x_last_insn; + return safe_as_a (insn); } /* Specify a new insn as the last in the chain. */ -- 2.47.3