aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine/JIT/JIT.h
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-07-12 15:51:55 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-07-12 15:51:55 +0000
commitee448630bdf7eb6037fe2c50518d32010c433ca3 (patch)
treef8ecc527ec9e16ba1b610b08cbb35e2e05e5ebef /lib/ExecutionEngine/JIT/JIT.h
parentb2164e5cb5086f0595e96fdbb5ffc614dea9c441 (diff)
downloadexternal_llvm-ee448630bdf7eb6037fe2c50518d32010c433ca3.zip
external_llvm-ee448630bdf7eb6037fe2c50518d32010c433ca3.tar.gz
external_llvm-ee448630bdf7eb6037fe2c50518d32010c433ca3.tar.bz2
For PR540:
This patch completes the changes for making lli thread-safe. Here's the list of changes: * The Support/ThreadSupport* files were removed and replaced with the MutexGuard.h file since all ThreadSupport* declared was a Mutex Guard. The implementation of MutexGuard.h is now based on sys::Mutex which hides its implementation and makes it unnecessary to have the -NoSupport.h and -PThreads.h versions of ThreadSupport. * All places in ExecutionEngine that previously referred to "Mutex" now refer to sys::Mutex * All places in ExecutionEngine that previously referred to "MutexLocker" now refer to MutexGuard (this is frivolous but I believe the technically correct name for such a class is "Guard" not a "Locker"). These changes passed all of llvm-test. All we need now are some test cases that actually use multiple threads. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22404 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JIT.h')
-rw-r--r--lib/ExecutionEngine/JIT/JIT.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.h b/lib/ExecutionEngine/JIT/JIT.h
index 3c14cf7..4cce144 100644
--- a/lib/ExecutionEngine/JIT/JIT.h
+++ b/lib/ExecutionEngine/JIT/JIT.h
@@ -27,18 +27,35 @@ class TargetMachine;
class TargetJITInfo;
class MachineCodeEmitter;
-class JIT : public ExecutionEngine {
- TargetMachine &TM; // The current target we are compiling to
- TargetJITInfo &TJI; // The JITInfo for the target we are compiling to
-
+class JITState {
+private:
FunctionPassManager PM; // Passes to compile a function
- MachineCodeEmitter *MCE; // MCE object
/// PendingGlobals - Global variables which have had memory allocated for them
/// while a function was code generated, but which have not been initialized
/// yet.
std::vector<const GlobalVariable*> PendingGlobals;
+public:
+ JITState(ModuleProvider *MP) : PM(MP) {}
+
+ FunctionPassManager& getPM(const MutexGuard& locked) {
+ return PM;
+ }
+
+ std::vector<const GlobalVariable*>& getPendingGlobals(const MutexGuard& locked) {
+ return PendingGlobals;
+ }
+};
+
+
+class JIT : public ExecutionEngine {
+ TargetMachine &TM; // The current target we are compiling to
+ TargetJITInfo &TJI; // The JITInfo for the target we are compiling to
+ MachineCodeEmitter *MCE; // MCE object
+
+ JITState state;
+
JIT(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji);
public:
~JIT();