1 /* Macros to support INSN_ADDRESSES
2 Copyright (C) 2000, 2007 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 3, 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 COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef GCC_INSN_ADDR_H
21 #define GCC_INSN_ADDR_H
25 extern VEC(int,heap
) *insn_addresses_
;
26 extern int insn_current_address
;
28 #define INSN_ADDRESSES(id) (*&(VEC_address (int, insn_addresses_) [id]))
29 #define INSN_ADDRESSES_ALLOC(size) \
32 insn_addresses_ = VEC_alloc (int, heap, size); \
33 VEC_safe_grow (int, heap, insn_addresses_, size); \
34 memset (VEC_address (int, insn_addresses_), \
35 0, sizeof (int) * size); \
38 #define INSN_ADDRESSES_FREE() (VEC_free (int, heap, insn_addresses_))
39 #define INSN_ADDRESSES_SET_P() (insn_addresses_ != 0)
40 #define INSN_ADDRESSES_SIZE() (VEC_length (int, insn_addresses_))
43 insn_addresses_new (rtx insn
, int insn_addr
)
45 unsigned insn_uid
= INSN_UID ((insn
));
47 if (INSN_ADDRESSES_SET_P ())
49 size_t size
= INSN_ADDRESSES_SIZE ();
53 VEC_safe_grow (int, heap
, insn_addresses_
, insn_uid
+ 1);
54 p
= VEC_address (int, insn_addresses_
);
56 0, sizeof (int) * (insn_uid
+ 1 - size
));
58 INSN_ADDRESSES (insn_uid
) = insn_addr
;
62 #define INSN_ADDRESSES_NEW(insn, addr) \
63 (insn_addresses_new (insn, addr))
65 #endif /* ! GCC_INSN_ADDR_H */