Mercurial > hg > CbC > CbC_gcc
comparison gcc/insn-addr.h @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | a06113de4d67 |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* Macros to support INSN_ADDRESSES | 1 /* Macros to support INSN_ADDRESSES |
2 Copyright (C) 2000, 2007 Free Software Foundation, Inc. | 2 Copyright (C) 2000-2017 Free Software Foundation, Inc. |
3 | 3 |
4 This file is part of GCC. | 4 This file is part of GCC. |
5 | 5 |
6 GCC is free software; you can redistribute it and/or modify it under | 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 | 7 the terms of the GNU General Public License as published by the Free |
18 <http://www.gnu.org/licenses/>. */ | 18 <http://www.gnu.org/licenses/>. */ |
19 | 19 |
20 #ifndef GCC_INSN_ADDR_H | 20 #ifndef GCC_INSN_ADDR_H |
21 #define GCC_INSN_ADDR_H | 21 #define GCC_INSN_ADDR_H |
22 | 22 |
23 #include "vecprim.h" | 23 extern vec<int> insn_addresses_; |
24 | |
25 extern VEC(int,heap) *insn_addresses_; | |
26 extern int insn_current_address; | 24 extern int insn_current_address; |
27 | 25 |
28 #define INSN_ADDRESSES(id) (*&(VEC_address (int, insn_addresses_) [id])) | 26 #define INSN_ADDRESSES(id) (insn_addresses_[id]) |
29 #define INSN_ADDRESSES_ALLOC(size) \ | 27 #define INSN_ADDRESSES_ALLOC(size) \ |
30 do \ | 28 do \ |
31 { \ | 29 { \ |
32 insn_addresses_ = VEC_alloc (int, heap, size); \ | 30 insn_addresses_.create (size); \ |
33 VEC_safe_grow (int, heap, insn_addresses_, size); \ | 31 insn_addresses_.safe_grow_cleared (size); \ |
34 memset (VEC_address (int, insn_addresses_), \ | 32 memset (insn_addresses_.address (), \ |
35 0, sizeof (int) * size); \ | 33 0, sizeof (int) * size); \ |
36 } \ | 34 } \ |
37 while (0) | 35 while (0) |
38 #define INSN_ADDRESSES_FREE() (VEC_free (int, heap, insn_addresses_)) | 36 #define INSN_ADDRESSES_FREE() (insn_addresses_.release ()) |
39 #define INSN_ADDRESSES_SET_P() (insn_addresses_ != 0) | 37 #define INSN_ADDRESSES_SET_P() (insn_addresses_.exists ()) |
40 #define INSN_ADDRESSES_SIZE() (VEC_length (int, insn_addresses_)) | 38 #define INSN_ADDRESSES_SIZE() (insn_addresses_.length ()) |
41 | 39 |
42 static inline void | 40 static inline void |
43 insn_addresses_new (rtx insn, int insn_addr) | 41 insn_addresses_new (rtx_insn *insn, int insn_addr) |
44 { | 42 { |
45 unsigned insn_uid = INSN_UID ((insn)); | 43 unsigned insn_uid = INSN_UID ((insn)); |
46 | 44 |
47 if (INSN_ADDRESSES_SET_P ()) | 45 if (INSN_ADDRESSES_SET_P ()) |
48 { | 46 { |
49 size_t size = INSN_ADDRESSES_SIZE (); | 47 size_t size = INSN_ADDRESSES_SIZE (); |
50 if (size <= insn_uid) | 48 if (size <= insn_uid) |
51 { | 49 { |
52 int *p; | 50 int *p; |
53 VEC_safe_grow (int, heap, insn_addresses_, insn_uid + 1); | 51 insn_addresses_.safe_grow (insn_uid + 1); |
54 p = VEC_address (int, insn_addresses_); | 52 p = insn_addresses_.address (); |
55 memset (&p[size], | 53 memset (&p[size], |
56 0, sizeof (int) * (insn_uid + 1 - size)); | 54 0, sizeof (int) * (insn_uid + 1 - size)); |
57 } | 55 } |
58 INSN_ADDRESSES (insn_uid) = insn_addr; | 56 INSN_ADDRESSES (insn_uid) = insn_addr; |
59 } | 57 } |