Skip to content

Commit 6e09857

Browse files
committed
dfmc-llvm-back-end: Separate out run-time library TLV support
This change allows run-time library support for thread_local variables to be enabled separately from use by generated Dylan code. * sources/dfmc/llvm-back-end/llvm-targets.dylan (llvm-runtime-thread-local-support?): New method on <llvm-back-end> defining whether runtime-variable definitions should be allowed to use LLVM thread_local, currently always returning #t. * sources/dfmc/llvm-back-end/llvm-primitives.dylan (llvm-runtime-variable): Use llvm-runtime-thread-local-support? rather than llvm-thread-local-support? to determine whether or not to use a thread-local storage model. * sources/dfmc/llvm-back-end/llvm-back-end-library.dylan (module dfmc-llvm-back-end): Export llvm-runtime-thread-local-support?. * sources/app/llvm-runtime-generator/llvm-runtime-c-header.dylan (print-runtime-variable-declaration): Use llvm-runtime-thread-local-support? rather than llvm-thread-local-support? to determine whether or not to declare runtime variables as __thread.
1 parent 381f34e commit 6e09857

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

sources/app/llvm-runtime-generator/llvm-runtime-c-header.dylan

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ define method print-runtime-variable-declaration
100100

101101
let thread-local?
102102
= member?(#"thread-local", descriptor.runtime-variable-attributes)
103-
& llvm-thread-local-support?(be);
103+
& llvm-runtime-thread-local-support?(be);
104104
if (thread-local?)
105105
format(stream, "__thread ");
106106
end if;

sources/dfmc/llvm-back-end/llvm-back-end-library.dylan

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ define module dfmc-llvm-back-end
4646

4747
llvm-mv-struct-type,
4848

49+
llvm-runtime-thread-local-support?,
4950
llvm-thread-local-support?,
5051
llvm-teb-struct-type,
5152

sources/dfmc/llvm-back-end/llvm-primitives.dylan

+1-1
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ define method llvm-runtime-variable
745745
let attributes = descriptor.runtime-variable-attributes;
746746
let thread-local?
747747
= member?(#"thread-local", attributes)
748-
& llvm-thread-local-support?(back-end);
748+
& llvm-runtime-thread-local-support?(back-end);
749749
let section
750750
= llvm-section-name(back-end, descriptor.runtime-variable-section,
751751
thread-local?: thread-local?);

sources/dfmc/llvm-back-end/llvm-targets.dylan

+6
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,12 @@ end method;
309309

310310
/// LLVM Thread-local storage platform support
311311

312+
define method llvm-runtime-thread-local-support?
313+
(back-end :: <llvm-back-end>)
314+
=> (support? :: <boolean>)
315+
#t
316+
end method;
317+
312318
define method llvm-thread-local-support?
313319
(back-end :: <llvm-back-end>)
314320
=> (support? :: <boolean>)

0 commit comments

Comments
 (0)