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 /include | |
parent | b74f370e437de31b53496e86f024b533ee8ec91b (diff) | |
download | external_llvm-46fa139e26be6ebc00be2fb45820c2560dd22a32.zip external_llvm-46fa139e26be6ebc00be2fb45820c2560dd22a32.tar.gz external_llvm-46fa139e26be6ebc00be2fb45820c2560dd22a32.tar.bz2 |
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 'include')
-rw-r--r-- | include/llvm/ExecutionEngine/ExecutionEngine.h | 3 | ||||
-rw-r--r-- | include/llvm/Target/TargetJITInfo.h | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h index 59db630..1ee8241 100644 --- a/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -76,6 +76,9 @@ protected: void setTargetData(const TargetData *td) { TD = td; } + + /// getMemoryforGV - Allocate memory for a global variable. + virtual char* getMemoryForGV(const GlobalVariable* GV); // To avoid having libexecutionengine depend on the JIT and interpreter // libraries, the JIT and Interpreter set these functions to ctor pointers diff --git a/include/llvm/Target/TargetJITInfo.h b/include/llvm/Target/TargetJITInfo.h index 6e1eb43..81e4c87 100644 --- a/include/llvm/Target/TargetJITInfo.h +++ b/include/llvm/Target/TargetJITInfo.h @@ -93,6 +93,14 @@ namespace llvm { unsigned NumRelocs, unsigned char* GOTBase) { assert(NumRelocs == 0 && "This target does not have relocations!"); } + + + /// 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) { + assert(0 && "This target does not implement thread local storage!"); + } /// needsGOT - Allows a target to specify that it would like the // JIT to manage a GOT for it. |