1 /* Macros to support INSN_ADDRESSES
2 Copyright (C) 2000 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING. If not, write to the Free
18 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
21 #ifndef GCC_INSN_ADDR_H
22 #define GCC_INSN_ADDR_H
26 extern VEC(int,heap
) *insn_addresses_
;
27 extern int insn_current_address
;
29 #define INSN_ADDRESSES(id) (*&(VEC_address (int, insn_addresses_) [id]))
30 #define INSN_ADDRESSES_ALLOC(size) \
33 insn_addresses_ = VEC_alloc (int, heap, size); \
34 VEC_safe_grow (int, heap, insn_addresses_, size); \
35 memset (VEC_address (int, insn_addresses_), \
36 0, sizeof (int) * size); \
39 #define INSN_ADDRESSES_FREE() (VEC_free (int, heap, insn_addresses_))
40 #define INSN_ADDRESSES_SET_P() (insn_addresses_ != 0)
41 #define INSN_ADDRESSES_SIZE() (VEC_length (int, insn_addresses_))
44 insn_addresses_new (rtx insn
, int insn_addr
)
46 unsigned insn_uid
= INSN_UID ((insn
));
48 if (INSN_ADDRESSES_SET_P ())
50 size_t size
= INSN_ADDRESSES_SIZE ();
54 VEC_safe_grow (int, heap
, insn_addresses_
, insn_uid
+ 1);
55 p
= VEC_address (int, insn_addresses_
);
57 0, sizeof (int) * (insn_uid
+ 1 - size
));
59 INSN_ADDRESSES (insn_uid
) = insn_addr
;
63 #define INSN_ADDRESSES_NEW(insn, addr) \
64 (insn_addresses_new (insn, addr))
66 #endif /* ! GCC_INSN_ADDR_H */