|
34 | 34 | #include "llutil.h" |
35 | 35 | #include "lldebug.h" |
36 | 36 | #include "go.h" |
| 37 | +#include "sharedefs.h" |
37 | 38 | #include <stdlib.h> |
38 | 39 | #include <stdio.h> |
39 | 40 | #include "llassem.h" |
@@ -193,15 +194,15 @@ static unsigned addressElementSize; |
193 | 194 |
|
194 | 195 | /* Exported variables */ |
195 | 196 |
|
196 | | -char **sptr_array = NULL; |
| 197 | +SPTRINFO_T sptrinfo; |
197 | 198 |
|
198 | 199 | /* This should live in llvm_info, but we need to access this module from other |
199 | 200 | * translation units temporarily */ |
200 | 201 | LL_Module *cpu_llvm_module = NULL; |
201 | 202 | #ifdef OMP_OFFLOAD_LLVM |
202 | 203 | LL_Module *gpu_llvm_module = NULL; |
203 | 204 | #endif |
204 | | -LL_Type **sptr_type_array = NULL; |
| 205 | + |
205 | 206 |
|
206 | 207 | /* File static variables */ |
207 | 208 |
|
@@ -13056,10 +13057,6 @@ static void |
13056 | 13057 | update_llvm_sym_arrays(void) |
13057 | 13058 | { |
13058 | 13059 | const int new_size = stb.stg_avail + MEM_EXTRA; |
13059 | | - int old_last_sym_avail = llvm_info.last_sym_avail; // NEEDB assigns |
13060 | | - NEEDB(stb.stg_avail, sptr_array, char *, llvm_info.last_sym_avail, new_size); |
13061 | | - NEEDB(stb.stg_avail, sptr_type_array, LL_Type *, old_last_sym_avail, |
13062 | | - new_size); |
13063 | 13060 | if ((flg.debug || XBIT(120, 0x1000)) && cpu_llvm_module) { |
13064 | 13061 | lldbg_update_arrays(cpu_llvm_module->debug_info, llvm_info.last_dtype_avail, |
13065 | 13062 | stb.dt.stg_avail + MEM_EXTRA); |
@@ -13107,11 +13104,14 @@ cg_llvm_init(void) |
13107 | 13104 | /* last_sym_avail is used for all the arrays below */ |
13108 | 13105 | llvm_info.last_sym_avail = stb.stg_avail + MEM_EXTRA; |
13109 | 13106 |
|
13110 | | - NEW(sptr_array, char *, stb.stg_avail + MEM_EXTRA); |
13111 | | - BZERO(sptr_array, char *, stb.stg_avail + MEM_EXTRA); |
13112 | | - /* set up the type array shadowing the symbol table */ |
13113 | | - NEW(sptr_type_array, LL_Type *, stb.stg_avail + MEM_EXTRA); |
13114 | | - BZERO(sptr_type_array, LL_Type *, stb.stg_avail + MEM_EXTRA); |
| 13107 | + if (sptrinfo.array.stg_base) { |
| 13108 | + STG_CLEAR_ALL(sptrinfo.array); |
| 13109 | + STG_CLEAR_ALL(sptrinfo.type_array); |
| 13110 | + } else { |
| 13111 | + STG_ALLOC_SIDECAR(stb, sptrinfo.array); |
| 13112 | + /* set up the type array shadowing the symbol table */ |
| 13113 | + STG_ALLOC_SIDECAR(stb, sptrinfo.type_array); |
| 13114 | + } |
13115 | 13115 |
|
13116 | 13116 | Globals = NULL; |
13117 | 13117 | recorded_Globals = NULL; |
|
0 commit comments