Changeset View
Changeset View
Standalone View
Standalone View
include/llvm/ExecutionEngine/ExecutionEngine.h
Show All 17 Lines | |||||
#include "llvm-c/ExecutionEngine.h" | #include "llvm-c/ExecutionEngine.h" | ||||
#include "llvm/ADT/SmallVector.h" | #include "llvm/ADT/SmallVector.h" | ||||
#include "llvm/ADT/StringRef.h" | #include "llvm/ADT/StringRef.h" | ||||
#include "llvm/IR/ValueHandle.h" | #include "llvm/IR/ValueHandle.h" | ||||
#include "llvm/IR/ValueMap.h" | #include "llvm/IR/ValueMap.h" | ||||
#include "llvm/MC/MCCodeGenInfo.h" | #include "llvm/MC/MCCodeGenInfo.h" | ||||
#include "llvm/Support/ErrorHandling.h" | #include "llvm/Support/ErrorHandling.h" | ||||
#include "llvm/Support/Mutex.h" | #include "llvm/Support/Mutex.h" | ||||
#include "llvm/Support/MutexGuard.h" | |||||
#include "llvm/Target/TargetMachine.h" | #include "llvm/Target/TargetMachine.h" | ||||
#include "llvm/Target/TargetOptions.h" | #include "llvm/Target/TargetOptions.h" | ||||
#include <map> | #include <map> | ||||
#include <string> | #include <string> | ||||
#include <vector> | #include <vector> | ||||
namespace llvm { | namespace llvm { | ||||
Show All 20 Lines | |||||
} | } | ||||
/// \brief Helper class for helping synchronize access to the global address map | /// \brief Helper class for helping synchronize access to the global address map | ||||
/// table. | /// table. | ||||
class ExecutionEngineState { | class ExecutionEngineState { | ||||
public: | public: | ||||
struct AddressMapConfig : public ValueMapConfig<const GlobalValue*> { | struct AddressMapConfig : public ValueMapConfig<const GlobalValue*> { | ||||
typedef ExecutionEngineState *ExtraData; | typedef ExecutionEngineState *ExtraData; | ||||
static sys::Mutex *getMutex(ExecutionEngineState *EES); | static sys::MutexBase *getMutex(ExecutionEngineState *EES); | ||||
static void onDelete(ExecutionEngineState *EES, const GlobalValue *Old); | static void onDelete(ExecutionEngineState *EES, const GlobalValue *Old); | ||||
static void onRAUW(ExecutionEngineState *, const GlobalValue *, | static void onRAUW(ExecutionEngineState *, const GlobalValue *, | ||||
const GlobalValue *); | const GlobalValue *); | ||||
}; | }; | ||||
typedef ValueMap<const GlobalValue *, void *, AddressMapConfig> | typedef ValueMap<const GlobalValue *, void *, AddressMapConfig> | ||||
GlobalAddressMapTy; | GlobalAddressMapTy; | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | protected: | ||||
/// pointer is invoked to create it. If this returns null, the JIT will | /// pointer is invoked to create it. If this returns null, the JIT will | ||||
/// abort. | /// abort. | ||||
void *(*LazyFunctionCreator)(const std::string &); | void *(*LazyFunctionCreator)(const std::string &); | ||||
public: | public: | ||||
/// lock - This lock protects the ExecutionEngine, MCJIT, JIT, JITResolver and | /// lock - This lock protects the ExecutionEngine, MCJIT, JIT, JITResolver and | ||||
/// JITEmitter classes. It must be held while changing the internal state of | /// JITEmitter classes. It must be held while changing the internal state of | ||||
/// any of those classes. | /// any of those classes. | ||||
sys::Mutex lock; | sys::RecursiveMutex lock; | ||||
//===--------------------------------------------------------------------===// | //===--------------------------------------------------------------------===// | ||||
// ExecutionEngine Startup | // ExecutionEngine Startup | ||||
//===--------------------------------------------------------------------===// | //===--------------------------------------------------------------------===// | ||||
virtual ~ExecutionEngine(); | virtual ~ExecutionEngine(); | ||||
/// create - This is the factory method for creating an execution engine which | /// create - This is the factory method for creating an execution engine which | ||||
▲ Show 20 Lines • Show All 559 Lines • Show Last 20 Lines |