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 | 46fa139e26be6ebc00be2fb45820c2560dd22a32 (patch) | |
tree | f7c8ee9b2e72cf5f751e6bd23b2ce782a1b3e01a /lib/Target/X86/X86JITInfo.h | |
parent | b74f370e437de31b53496e86f024b533ee8ec91b (diff) | |
download | llvm-46fa139e26be6ebc00be2fb45820c2560dd22a32.tar.gz llvm-46fa139e26be6ebc00be2fb45820c2560dd22a32.tar.bz2 llvm-46fa139e26be6ebc00be2fb45820c2560dd22a32.tar.xz |
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.h')
-rw-r--r-- | lib/Target/X86/X86JITInfo.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Target/X86/X86JITInfo.h b/lib/Target/X86/X86JITInfo.h index f9fcefecff..6b8d197846 100644 --- a/lib/Target/X86/X86JITInfo.h +++ b/lib/Target/X86/X86JITInfo.h @@ -23,8 +23,12 @@ namespace llvm { class X86JITInfo : public TargetJITInfo { X86TargetMachine &TM; intptr_t PICBase; + char* TLSOffset; public: - explicit X86JITInfo(X86TargetMachine &tm) : TM(tm) {useGOT = 0;} + explicit X86JITInfo(X86TargetMachine &tm) : TM(tm) { + useGOT = 0; + TLSOffset = 0; + } /// replaceMachineCodeForFunction - Make it so that calling the function /// whose machine code is at OLD turns into a call to NEW, perhaps by @@ -56,6 +60,11 @@ namespace llvm { /// referenced global symbols. virtual void relocate(void *Function, MachineRelocation *MR, unsigned NumRelocs, unsigned char* GOTBase); + + /// allocateThreadLocalMemory - Each target has its own way of + /// handling thread local variables. This method returns a value only + /// meaningful to the target. + virtual char* allocateThreadLocalMemory(size_t size); /// setPICBase / getPICBase - Getter / setter of PICBase, used to compute /// PIC jumptable entry. |