diff options
author | Nicolas Geoffray <nicolas.geoffray@lip6.fr> | 2008-10-25 15:41:43 +0000 |
---|---|---|
committer | Nicolas Geoffray <nicolas.geoffray@lip6.fr> | 2008-10-25 15:41:43 +0000 |
commit | 5457ce9ac34381f3cd66676dfe63d3aeb2620f42 (patch) | |
tree | 7224d798aaca619d5c646fc13bdfa85d6420469d /llvm/lib/Target/X86/X86JITInfo.cpp | |
parent | db30612fc4c61a72b30fe4c3dee92ba436bc483b (diff) | |
download | bcm5719-llvm-5457ce9ac34381f3cd66676dfe63d3aeb2620f42.tar.gz bcm5719-llvm-5457ce9ac34381f3cd66676dfe63d3aeb2620f42.zip |
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.
llvm-svn: 58142
Diffstat (limited to 'llvm/lib/Target/X86/X86JITInfo.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86JITInfo.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86JITInfo.cpp b/llvm/lib/Target/X86/X86JITInfo.cpp index 7b3a0703277..f8761dc87e2 100644 --- a/llvm/lib/Target/X86/X86JITInfo.cpp +++ b/llvm/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 +} |