Move get_call_rtx_from to final.c and call call_from_call_insn.
PR other/120493
* final.cc (call_from_call_insn): Change the argument type to
const rtx_call_insn *.
(get_call_rtx_from): New.
* rtl.h (is_a_helper <const rtx_call_insn *>::test): New.
(get_call_rtx_from): Moved to the final.cc section.
* rtlanal.cc (get_call_rtx_from): Removed.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
/* Given a CALL_INSN, find and return the nested CALL. */
static rtx
-call_from_call_insn (rtx_call_insn *insn)
+call_from_call_insn (const rtx_call_insn *insn)
{
rtx x;
gcc_assert (CALL_P (insn));
return x;
}
+/* Return the CALL in X if there is one. */
+
+rtx
+get_call_rtx_from (const rtx_insn *insn)
+{
+ const rtx_call_insn *call_insn = as_a<const rtx_call_insn *> (insn);
+ return call_from_call_insn (call_insn);
+}
+
/* Print a comment into the asm showing FILENAME, LINENUM, and the
corresponding source line, if available. */
return CALL_P (insn);
}
+template <>
+template <>
+inline bool
+is_a_helper <const rtx_call_insn *>::test (const rtx_insn *insn)
+{
+ return CALL_P (insn);
+}
+
template <>
template <>
inline bool
extern bool rtx_unstable_p (const_rtx);
extern bool rtx_varies_p (const_rtx, bool);
extern bool rtx_addr_varies_p (const_rtx, bool);
-extern rtx get_call_rtx_from (const rtx_insn *);
extern tree get_call_fndecl (const rtx_insn *);
extern HOST_WIDE_INT get_integer_term (const_rtx);
extern rtx get_related_value (const_rtx);
extern void compute_alignments (void);
extern void update_alignments (vec<rtx> &);
extern int asm_str_count (const char *templ);
+extern rtx get_call_rtx_from (const rtx_insn *);
\f
struct rtl_hooks
{
return false;
}
\f
-/* Return the CALL in X if there is one. */
-
-rtx
-get_call_rtx_from (const rtx_insn *insn)
-{
- rtx x = PATTERN (insn);
- if (GET_CODE (x) == PARALLEL)
- x = XVECEXP (x, 0, 0);
- if (GET_CODE (x) == SET)
- x = SET_SRC (x);
- if (GET_CODE (x) == CALL && MEM_P (XEXP (x, 0)))
- return x;
- return NULL_RTX;
-}
-
/* Get the declaration of the function called by INSN. */
tree