insn-addr.h revision 117395
155714Skris/* Macros to support INSN_ADDRESSES
255714Skris   Copyright (C) 2000 Free Software Foundation, Inc.
355714Skris
455714SkrisThis file is part of GCC.
555714Skris
655714SkrisGCC is free software; you can redistribute it and/or modify it under
755714Skristhe terms of the GNU General Public License as published by the Free
855714SkrisSoftware Foundation; either version 2, or (at your option) any later
955714Skrisversion.
1055714Skris
1155714SkrisGCC is distributed in the hope that it will be useful, but WITHOUT ANY
1255714SkrisWARRANTY; without even the implied warranty of MERCHANTABILITY or
1355714SkrisFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1455714Skrisfor more details.
1555714Skris
1655714SkrisYou should have received a copy of the GNU General Public License
1755714Skrisalong with GCC; see the file COPYING.  If not, write to the Free
1855714SkrisSoftware Foundation, 59 Temple Place - Suite 330, Boston, MA
1955714Skris02111-1307, USA.  */
2055714Skris
2155714Skris#ifndef GCC_INSN_ADDR_H
2255714Skris#define GCC_INSN_ADDR_H
2355714Skris
2455714Skris#include "varray.h"
2555714Skris
2655714Skrisextern GTY(()) varray_type insn_addresses_;
2755714Skrisextern int insn_current_address;
2855714Skris
2955714Skris#define INSN_ADDRESSES_DEFN() varray_type insn_addresses_
3055714Skris#define INSN_ADDRESSES(id) VARRAY_INT (insn_addresses_, (id))
3155714Skris#define INSN_ADDRESSES_ALLOC(size) \
3255714Skris  VARRAY_INT_INIT (insn_addresses_, (size), "insn_addresses")
3355714Skris#define INSN_ADDRESSES_FREE() (insn_addresses_ = 0)
3455714Skris#define INSN_ADDRESSES_SET_P() (insn_addresses_ != 0)
3555714Skris#define INSN_ADDRESSES_SIZE() VARRAY_SIZE (insn_addresses_)
3655714Skris#define INSN_ADDRESSES_NEW(insn, addr) do \
3755714Skris  {									\
3855714Skris    unsigned insn_uid__ = INSN_UID ((insn));				\
3955714Skris    int insn_addr__ = (addr);						\
4055714Skris									\
4155714Skris    if (INSN_ADDRESSES_SET_P ())					\
4255714Skris      {									\
4355714Skris	if (INSN_ADDRESSES_SIZE () <= insn_uid__)			\
4455714Skris	  VARRAY_GROW (insn_addresses_, insn_uid__ + 1);		\
4555714Skris	INSN_ADDRESSES (insn_uid__) = insn_addr__;			\
4655714Skris      }									\
4755714Skris  }									\
4855714Skriswhile (0)
4955714Skris
5055714Skris#endif /* ! GCC_INSN_ADDR_H */
5155714Skris