Changeset View
Changeset View
Standalone View
Standalone View
lib/ExecutionEngine/JIT/JIT.cpp
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | ExecutionEngine *JIT::createJIT(Module *M, | ||||
} | } | ||||
} | } | ||||
namespace { | namespace { | ||||
/// This class supports the global getPointerToNamedFunction(), which allows | /// This class supports the global getPointerToNamedFunction(), which allows | ||||
/// bugpoint or gdb users to search for a function by name without any context. | /// bugpoint or gdb users to search for a function by name without any context. | ||||
class JitPool { | class JitPool { | ||||
SmallPtrSet<JIT*, 1> JITs; // Optimize for process containing just 1 JIT. | SmallPtrSet<JIT*, 1> JITs; // Optimize for process containing just 1 JIT. | ||||
mutable sys::Mutex Lock; | mutable sys::RecursiveMutex Lock; | ||||
public: | public: | ||||
void Add(JIT *jit) { | void Add(JIT *jit) { | ||||
MutexGuard guard(Lock); | MutexGuard guard(Lock); | ||||
JITs.insert(jit); | JITs.insert(jit); | ||||
} | } | ||||
void Remove(JIT *jit) { | void Remove(JIT *jit) { | ||||
MutexGuard guard(Lock); | MutexGuard guard(Lock); | ||||
JITs.erase(jit); | JITs.erase(jit); | ||||
▲ Show 20 Lines • Show All 588 Lines • Show Last 20 Lines |