summaryrefslogtreecommitdiff
path: root/gcc/insn-addr.h
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2000-07-28 02:17:26 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2000-07-28 02:17:26 +0000
commit9d98a69423a0bf6d7f6c33f1f05f70c74282d65b (patch)
treeef8a8d9eb4fda8faa814cb484ce4a1e01ef25372 /gcc/insn-addr.h
parentb87487b66a26b2db805a02e59b25bffb9438fb14 (diff)
Makefile.in (INSN_ATTR_H): New macro.
* Makefile.in (INSN_ATTR_H): New macro. Replace all dependencies on insn-attr.h with it. * genattr.c: Generate `#include "insn-addr.h"' if HAVE_ATTR_length. * insn-addr.h: New header. (insn_addresses_): Renamed from insn_addresses. (INSN_ADDRESSES_DEFN, INSN_ADDRESSES, INSN_ADDRESSES_ALLOC, INSN_ADDRESSES_FREE, INSN_ADDRESSES_SET_P, INSN_ADDRESSES_SIZE, INSN_ADDRESSES_NEW): New macros. * genattrtab.c (write_test_expr): Use new macros. * final.c (insn_addresses, init_insn_lengths): Likewise. (align_fuzz, shorten_branches): Likewise. (final): Likewise. Do not reject new insns if their addresses have been added to INSN_ADDRESSES. * config/arm/arm.c, config/avr/avr.c: Use new macros. * config/h8300/h8300.c, config/i370/i370.c: Likewise. * config/m88k/m88k.c, config/pa/pa.c, config/pa/pa.md: Likewise. * config/sparc/sparc.c, config/sparc/sparc.md: Likewise. * config/sh/sh.c: Likewise. (output_branchy_insn): Use INSN_ADDRESSES_NEW. From-SVN: r35307
Diffstat (limited to 'gcc/insn-addr.h')
-rw-r--r--gcc/insn-addr.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/gcc/insn-addr.h b/gcc/insn-addr.h
new file mode 100644
index 00000000000..4ae59f7fddb
--- /dev/null
+++ b/gcc/insn-addr.h
@@ -0,0 +1,46 @@
+/* Macros to support INSN_ADDRESSES
+ Copyright (C) 2000 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#ifndef _INSN_ADDR_H
+#define _INSN_ADDR_H 1
+
+#include "varray.h"
+
+extern varray_type insn_addresses_;
+extern int insn_current_address;
+
+#define INSN_ADDRESSES_DEFN() varray_type insn_addresses_
+#define INSN_ADDRESSES(id) VARRAY_INT (insn_addresses_, (id))
+#define INSN_ADDRESSES_ALLOC(size) \
+ VARRAY_INT_INIT (insn_addresses_, (size), "insn_addresses")
+#define INSN_ADDRESSES_FREE() VARRAY_FREE (insn_addresses_)
+#define INSN_ADDRESSES_SET_P() (insn_addresses_ != 0)
+#define INSN_ADDRESSES_SIZE() VARRAY_SIZE (insn_addresses_)
+#define INSN_ADDRESSES_NEW(insn,addr) do { \
+ int insn_uid__ = INSN_UID ((insn)), insn_addr__ = (addr); \
+ \
+ if (INSN_ADDRESSES_SET_P()) { \
+ if (INSN_ADDRESSES_SIZE() <= insn_uid__) \
+ insn_addresses_ = VARRAY_GROW (insn_addresses_, insn_uid__ + 1); \
+ INSN_ADDRESSES (insn_uid__) = insn_addr__; \
+ } \
+} while (0)
+
+#endif /* _INSN_ADDR_H */