insn-addr.h revision 90075
11590Srgrimes/* Macros to support INSN_ADDRESSES 21590Srgrimes Copyright (C) 2000 Free Software Foundation, Inc. 31590Srgrimes 41590SrgrimesThis file is part of GCC. 51590Srgrimes 61590SrgrimesGCC is free software; you can redistribute it and/or modify it under 71590Srgrimesthe terms of the GNU General Public License as published by the Free 81590SrgrimesSoftware Foundation; either version 2, or (at your option) any later 91590Srgrimesversion. 101590Srgrimes 111590SrgrimesGCC is distributed in the hope that it will be useful, but WITHOUT ANY 121590SrgrimesWARRANTY; without even the implied warranty of MERCHANTABILITY or 131590SrgrimesFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 141590Srgrimesfor more details. 151590Srgrimes 161590SrgrimesYou should have received a copy of the GNU General Public License 171590Srgrimesalong with GCC; see the file COPYING. If not, write to the Free 181590SrgrimesSoftware Foundation, 59 Temple Place - Suite 330, Boston, MA 191590Srgrimes02111-1307, USA. */ 201590Srgrimes 211590Srgrimes#ifndef GCC_INSN_ADDR_H 221590Srgrimes#define GCC_INSN_ADDR_H 231590Srgrimes 241590Srgrimes#include "varray.h" 251590Srgrimes 261590Srgrimesextern varray_type insn_addresses_; 271590Srgrimesextern int insn_current_address; 281590Srgrimes 291590Srgrimes#define INSN_ADDRESSES_DEFN() varray_type insn_addresses_ 301590Srgrimes#define INSN_ADDRESSES(id) VARRAY_INT (insn_addresses_, (id)) 311590Srgrimes#define INSN_ADDRESSES_ALLOC(size) \ 321590Srgrimes VARRAY_INT_INIT (insn_addresses_, (size), "insn_addresses") 331590Srgrimes#define INSN_ADDRESSES_FREE() VARRAY_FREE (insn_addresses_) 341590Srgrimes#define INSN_ADDRESSES_SET_P() (insn_addresses_ != 0) 351590Srgrimes#define INSN_ADDRESSES_SIZE() VARRAY_SIZE (insn_addresses_) 361590Srgrimes#define INSN_ADDRESSES_NEW(insn, addr) do \ 371590Srgrimes { \ 381590Srgrimes unsigned insn_uid__ = INSN_UID ((insn)); \ 391590Srgrimes int insn_addr__ = (addr); \ 401590Srgrimes \ 411590Srgrimes if (INSN_ADDRESSES_SET_P ()) \ 421590Srgrimes { \ 431590Srgrimes if (INSN_ADDRESSES_SIZE () <= insn_uid__) \ 441590Srgrimes VARRAY_GROW (insn_addresses_, insn_uid__ + 1); \ 451590Srgrimes INSN_ADDRESSES (insn_uid__) = insn_addr__; \ 461590Srgrimes } \ 471590Srgrimes } \ 481590Srgrimeswhile (0) 491590Srgrimes 501590Srgrimes#endif /* ! GCC_INSN_ADDR_H */ 511590Srgrimes