aboutsummaryrefslogtreecommitdiff
path: root/gcc/gensupport.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2015-06-14 20:25:40 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2015-06-14 20:25:40 +0000
commit3beaff21f346c7f34bf45f7b56f2c1c880a91e31 (patch)
tree5c9473ab1cc9660cc825b2a8b95569ab4d1e7cc6 /gcc/gensupport.c
parentb25b4ed2b7010c0d36474b4caf3f7fe1a094095c (diff)
downloadgcc-3beaff21f346c7f34bf45f7b56f2c1c880a91e31.zip
gcc-3beaff21f346c7f34bf45f7b56f2c1c880a91e31.tar.gz
gcc-3beaff21f346c7f34bf45f7b56f2c1c880a91e31.tar.bz2
rtl.h (classify_insn): Declare.
gcc/ * rtl.h (classify_insn): Declare. * emit-rtl.c (classify_insn): Move to... * rtl.c: ...here and add generator support. * gensupport.h (get_emit_function, needs_barrier_p): Declare. * gensupport.c (get_emit_function, needs_barrier_p): New functions. * genemit.c (gen_emit_seq): New function. (gen_expand, gen_split): Use it. From-SVN: r224470
Diffstat (limited to 'gcc/gensupport.c')
-rw-r--r--gcc/gensupport.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index dc73cf9..916fbc1 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -2982,3 +2982,37 @@ get_pattern_stats (struct pattern_stats *stats, rtvec pattern)
MAX (stats->max_dup_opno,
stats->max_scratch_opno)) + 1;
}
+
+/* Return the emit_* function that should be used for pattern X. */
+
+const char *
+get_emit_function (rtx x)
+{
+ switch (classify_insn (x))
+ {
+ case INSN:
+ return "emit_insn";
+
+ case CALL_INSN:
+ return "emit_call_insn";
+
+ case JUMP_INSN:
+ return "emit_jump_insn";
+
+ case UNKNOWN:
+ return "emit";
+
+ default:
+ gcc_unreachable ();
+ }
+}
+
+/* Return true if we must emit a barrier after pattern X. */
+
+bool
+needs_barrier_p (rtx x)
+{
+ return (GET_CODE (x) == SET
+ && GET_CODE (SET_DEST (x)) == PC
+ && GET_CODE (SET_SRC (x)) == LABEL_REF);
+}