| commit 941: | 23f5feaa3b42 |
| parent 940: | 4d5a539259ec |
| branch: | default |
Add new attribute tls-model to class ST because every TLS variable can have its own model.
NVISA does not use TLS, so this new attribute only applies to all other targets.
13 months ago
Changed (Δ1.1 KB):
raw changeset »
osprey/common/com/symtab.cxx (24 lines added, 0 lines removed)
osprey/common/com/symtab_access.h (6 lines added, 0 lines removed)
osprey/common/com/symtab_defs.h (12 lines added, 2 lines removed)
Up to file-list osprey/common/com/symtab.cxx:
| … | … | @@ -1847,6 +1847,30 @@ ST::Print (FILE *f, BOOL verbose) const |
1847 |
1847 |
fprintf (f, " __texture__"); |
1848 |
1848 |
if (memory_space == MEMORY_PARAM) |
1849 |
1849 |
fprintf (f, " __param__"); |
1850 |
#else |
|
1851 |
// tls-model |
|
1852 |
if (flags_ext & ST_IS_THREAD_LOCAL) { |
|
1853 |
switch (tls_model) { |
|
1854 |
case TLS_NONE: |
|
1855 |
fputs (", TLS:none", f); |
|
1856 |
break; |
|
1857 |
case TLS_EMULATED: |
|
1858 |
fputs (", TLS:emulated", f); |
|
1859 |
break; |
|
1860 |
case TLS_GLOBAL_DYNAMIC: |
|
1861 |
fputs (", TLS:global-dynamic", f); |
|
1862 |
break; |
|
1863 |
case TLS_LOCAL_DYNAMIC: |
|
1864 |
fputs (", TLS:local-dynamic", f); |
|
1865 |
break; |
|
1866 |
case TLS_INITIAL_EXEC: |
|
1867 |
fputs (", TLS:initial-exec", f); |
|
1868 |
break; |
|
1869 |
case TLS_LOCAL_EXEC: |
|
1870 |
fputs (", TLS:local-exec", f); |
|
1871 |
break; |
|
1872 |
} |
|
1873 |
} |
|
1850 |
1874 |
#endif /* TARG_NVISA */ |
1851 |
1875 |
|
1852 |
1876 |
switch (export_class) { |
Up to file-list osprey/common/com/symtab_access.h:
| … | … | @@ -657,6 +657,12 @@ inline BOOL |
657 |
657 |
ST_in_param_mem (const ST* s) { return (s->memory_space == MEMORY_PARAM); } |
658 |
658 |
inline void |
659 |
659 |
Set_ST_in_param_mem (ST *s) { s->memory_space = MEMORY_PARAM; } |
660 |
#else |
|
661 |
/* tls-model */ |
|
662 |
inline ST_TLS_MODEL |
|
663 |
ST_tls_model (const ST* s) { return s->tls_model; } |
|
664 |
inline void |
|
665 |
Set_ST_tls_model (ST* s, ST_TLS_MODEL model) { s->tls_model = model; } |
|
660 |
666 |
#endif /* TARG_NVISA */ |
661 |
667 |
|
662 |
668 |
inline BOOL |
Up to file-list osprey/common/com/symtab_defs.h:
| … | … | @@ -136,6 +136,16 @@ enum ST_MEMORY |
136 |
136 |
MEMORY_PARAM = 6, |
137 |
137 |
MEMORY_COUNT = 7 |
138 |
138 |
}; // ST_MEMORY |
139 |
#else |
|
140 |
enum ST_TLS_MODEL { |
|
141 |
TLS_NONE, |
|
142 |
TLS_EMULATED, /* for emulated tls */ |
|
143 |
TLS_REAL, |
|
144 |
TLS_GLOBAL_DYNAMIC = TLS_REAL, |
|
145 |
TLS_LOCAL_DYNAMIC, |
|
146 |
TLS_INITIAL_EXEC, |
|
147 |
TLS_LOCAL_EXEC, |
|
148 |
}; // TLS_MODEL |
|
139 |
149 |
#endif /* TARG_NVISA */ |
140 |
150 |
|
141 |
151 |
enum ST_FLAGS |
| … | … | @@ -223,11 +233,11 @@ public: |
223 |
233 |
|
224 |
234 |
ST_CLASS sym_class : 8; // class info |
225 |
235 |
ST_SCLASS storage_class : 8; // storage info |
236 |
ST_EXPORT export_class : 4; // export class of the symbol |
|
226 |
237 |
#ifdef TARG_NVISA |
227 |
ST_EXPORT export_class : 4; // export class of the symbol |
|
228 |
238 |
ST_MEMORY memory_space: 4; // memory space of the symbol |
229 |
239 |
#else |
230 |
ST_ |
|
240 |
ST_TLS_MODEL tls_model: 4; // Thread-Local-Storage(TLS) model |
|
231 |
241 |
#endif |
232 |
242 |
union { |
233 |
243 |
TY_IDX type; // idx to high-level type |
