aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86JITInfo.cpp
diff options
context:
space:
mode:
authorNicolas Geoffray <nicolas.geoffray@lip6.fr>2008-10-25 15:41:43 +0000
committerNicolas Geoffray <nicolas.geoffray@lip6.fr>2008-10-25 15:41:43 +0000
commit46fa139e26be6ebc00be2fb45820c2560dd22a32 (patch)
treef7c8ee9b2e72cf5f751e6bd23b2ce782a1b3e01a /lib/Target/X86/X86JITInfo.cpp
parentb74f370e437de31b53496e86f024b533ee8ec91b (diff)
Support for allocation of TLS variables in the JIT. Allocation of a global
variable is moved to the execution engine. The JIT calls the TargetJITInfo to allocate thread local storage. Currently, only linux/x86 knows how to allocate thread local global variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58142 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86JITInfo.cpp')
-rw-r--r--lib/Target/X86/X86JITInfo.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Target/X86/X86JITInfo.cpp b/lib/Target/X86/X86JITInfo.cpp
index 7b3a070327..f8761dc87e 100644
--- a/lib/Target/X86/X86JITInfo.cpp
+++ b/lib/Target/X86/X86JITInfo.cpp
@@ -518,3 +518,13 @@ void X86JITInfo::relocate(void *Function, MachineRelocation *MR,
}
}
}
+
+char* X86JITInfo::allocateThreadLocalMemory(size_t size) {
+#if defined(X86_32_JIT) && !defined(__APPLE__) && !defined(_MSC_VER)
+ TLSOffset -= size;
+ return TLSOffset;
+#else
+ assert(0 && "Cannot allocate thread local storage on this arch!\n");
+ return 0;
+#endif
+}