insn-addr.h revision 169689
1198090Srdivacky/* Macros to support INSN_ADDRESSES 2198090Srdivacky Copyright (C) 2000 Free Software Foundation, Inc. 3198090Srdivacky 4198090SrdivackyThis file is part of GCC. 5198090Srdivacky 6198090SrdivackyGCC is free software; you can redistribute it and/or modify it under 7198090Srdivackythe terms of the GNU General Public License as published by the Free 8198090SrdivackySoftware Foundation; either version 2, or (at your option) any later 9198090Srdivackyversion. 10198090Srdivacky 11198090SrdivackyGCC is distributed in the hope that it will be useful, but WITHOUT ANY 12198090SrdivackyWARRANTY; without even the implied warranty of MERCHANTABILITY or 13198090SrdivackyFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14198090Srdivackyfor more details. 15198090Srdivacky 16198090SrdivackyYou should have received a copy of the GNU General Public License 17198090Srdivackyalong with GCC; see the file COPYING. If not, write to the Free 18198090SrdivackySoftware Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 19198090Srdivacky02110-1301, USA. */ 20198090Srdivacky 21198090Srdivacky#ifndef GCC_INSN_ADDR_H 22198090Srdivacky#define GCC_INSN_ADDR_H 23198090Srdivacky 24198090Srdivacky#include "varray.h" 25198090Srdivacky 26198090Srdivackyextern GTY(()) varray_type insn_addresses_; 27198090Srdivackyextern int insn_current_address; 28198090Srdivacky 29198090Srdivacky#define INSN_ADDRESSES_DEFN() varray_type insn_addresses_ 30198090Srdivacky#define INSN_ADDRESSES(id) VARRAY_INT (insn_addresses_, (id)) 31198090Srdivacky#define INSN_ADDRESSES_ALLOC(size) \ 32198090Srdivacky VARRAY_INT_INIT (insn_addresses_, (size), "insn_addresses") 33198090Srdivacky#define INSN_ADDRESSES_FREE() (insn_addresses_ = 0) 34198090Srdivacky#define INSN_ADDRESSES_SET_P() (insn_addresses_ != 0) 35198090Srdivacky#define INSN_ADDRESSES_SIZE() VARRAY_SIZE (insn_addresses_) 36198090Srdivacky#define INSN_ADDRESSES_NEW(insn, addr) do \ 37198090Srdivacky { \ 38198090Srdivacky unsigned insn_uid__ = INSN_UID ((insn)); \ 39198090Srdivacky int insn_addr__ = (addr); \ 40198090Srdivacky \ 41198090Srdivacky if (INSN_ADDRESSES_SET_P ()) \ 42198090Srdivacky { \ 43198090Srdivacky if (INSN_ADDRESSES_SIZE () <= insn_uid__) \ 44198090Srdivacky VARRAY_GROW (insn_addresses_, insn_uid__ + 1); \ 45198090Srdivacky INSN_ADDRESSES (insn_uid__) = insn_addr__; \ 46198090Srdivacky } \ 47198090Srdivacky } \ 48198090Srdivackywhile (0) 49198090Srdivacky 50198090Srdivacky#endif /* ! GCC_INSN_ADDR_H */ 51198090Srdivacky