|
@@ -31,46 +31,47 @@ public:
|
|
LinkingMemoryManager(MCJIT *Parent, RTDyldMemoryManager *MM)
|
|
LinkingMemoryManager(MCJIT *Parent, RTDyldMemoryManager *MM)
|
|
: ParentEngine(Parent), ClientMM(MM) {}
|
|
: ParentEngine(Parent), ClientMM(MM) {}
|
|
|
|
|
|
- virtual uint64_t getSymbolAddress(const std::string &Name);
|
|
|
|
|
|
+ uint64_t getSymbolAddress(const std::string &Name) override;
|
|
|
|
|
|
// Functions deferred to client memory manager
|
|
// Functions deferred to client memory manager
|
|
- virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
|
|
|
|
- unsigned SectionID, StringRef SectionName) {
|
|
|
|
|
|
+ uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
|
|
|
|
+ unsigned SectionID,
|
|
|
|
+ StringRef SectionName) override {
|
|
return ClientMM->allocateCodeSection(Size, Alignment, SectionID, SectionName);
|
|
return ClientMM->allocateCodeSection(Size, Alignment, SectionID, SectionName);
|
|
}
|
|
}
|
|
|
|
|
|
- virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
|
|
|
|
- unsigned SectionID, StringRef SectionName,
|
|
|
|
- bool IsReadOnly) {
|
|
|
|
|
|
+ uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
|
|
|
|
+ unsigned SectionID, StringRef SectionName,
|
|
|
|
+ bool IsReadOnly) override {
|
|
return ClientMM->allocateDataSection(Size, Alignment,
|
|
return ClientMM->allocateDataSection(Size, Alignment,
|
|
SectionID, SectionName, IsReadOnly);
|
|
SectionID, SectionName, IsReadOnly);
|
|
}
|
|
}
|
|
-
|
|
|
|
- virtual void reserveAllocationSpace(
|
|
|
|
- uintptr_t CodeSize, uintptr_t DataSizeRO, uintptr_t DataSizeRW) {
|
|
|
|
|
|
+
|
|
|
|
+ void reserveAllocationSpace(uintptr_t CodeSize, uintptr_t DataSizeRO,
|
|
|
|
+ uintptr_t DataSizeRW) override {
|
|
return ClientMM->reserveAllocationSpace(CodeSize, DataSizeRO, DataSizeRW);
|
|
return ClientMM->reserveAllocationSpace(CodeSize, DataSizeRO, DataSizeRW);
|
|
}
|
|
}
|
|
-
|
|
|
|
- virtual bool needsToReserveAllocationSpace() {
|
|
|
|
|
|
+
|
|
|
|
+ bool needsToReserveAllocationSpace() override {
|
|
return ClientMM->needsToReserveAllocationSpace();
|
|
return ClientMM->needsToReserveAllocationSpace();
|
|
}
|
|
}
|
|
|
|
|
|
- virtual void notifyObjectLoaded(ExecutionEngine *EE,
|
|
|
|
- const ObjectImage *Obj) {
|
|
|
|
|
|
+ void notifyObjectLoaded(ExecutionEngine *EE,
|
|
|
|
+ const ObjectImage *Obj) override {
|
|
ClientMM->notifyObjectLoaded(EE, Obj);
|
|
ClientMM->notifyObjectLoaded(EE, Obj);
|
|
}
|
|
}
|
|
|
|
|
|
- virtual void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) {
|
|
|
|
|
|
+ void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr,
|
|
|
|
+ size_t Size) override {
|
|
ClientMM->registerEHFrames(Addr, LoadAddr, Size);
|
|
ClientMM->registerEHFrames(Addr, LoadAddr, Size);
|
|
}
|
|
}
|
|
|
|
|
|
- virtual void deregisterEHFrames(uint8_t *Addr,
|
|
|
|
- uint64_t LoadAddr,
|
|
|
|
- size_t Size) {
|
|
|
|
|
|
+ void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr,
|
|
|
|
+ size_t Size) override {
|
|
ClientMM->deregisterEHFrames(Addr, LoadAddr, Size);
|
|
ClientMM->deregisterEHFrames(Addr, LoadAddr, Size);
|
|
}
|
|
}
|
|
|
|
|
|
- virtual bool finalizeMemory(std::string *ErrMsg = 0) {
|
|
|
|
|
|
+ bool finalizeMemory(std::string *ErrMsg = 0) override {
|
|
return ClientMM->finalizeMemory(ErrMsg);
|
|
return ClientMM->finalizeMemory(ErrMsg);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -237,20 +238,20 @@ public:
|
|
|
|
|
|
/// @name ExecutionEngine interface implementation
|
|
/// @name ExecutionEngine interface implementation
|
|
/// @{
|
|
/// @{
|
|
- virtual void addModule(Module *M);
|
|
|
|
- virtual void addObjectFile(object::ObjectFile *O);
|
|
|
|
- virtual void addArchive(object::Archive *O);
|
|
|
|
- virtual bool removeModule(Module *M);
|
|
|
|
|
|
+ void addModule(Module *M) override;
|
|
|
|
+ void addObjectFile(object::ObjectFile *O) override;
|
|
|
|
+ void addArchive(object::Archive *O) override;
|
|
|
|
+ bool removeModule(Module *M) override;
|
|
|
|
|
|
/// FindFunctionNamed - Search all of the active modules to find the one that
|
|
/// FindFunctionNamed - Search all of the active modules to find the one that
|
|
/// defines FnName. This is very slow operation and shouldn't be used for
|
|
/// defines FnName. This is very slow operation and shouldn't be used for
|
|
/// general code.
|
|
/// general code.
|
|
- virtual Function *FindFunctionNamed(const char *FnName);
|
|
|
|
|
|
+ Function *FindFunctionNamed(const char *FnName) override;
|
|
|
|
|
|
/// Sets the object manager that MCJIT should use to avoid compilation.
|
|
/// Sets the object manager that MCJIT should use to avoid compilation.
|
|
- virtual void setObjectCache(ObjectCache *manager);
|
|
|
|
|
|
+ void setObjectCache(ObjectCache *manager) override;
|
|
|
|
|
|
- virtual void generateCodeForModule(Module *M);
|
|
|
|
|
|
+ void generateCodeForModule(Module *M) override;
|
|
|
|
|
|
/// finalizeObject - ensure the module is fully processed and is usable.
|
|
/// finalizeObject - ensure the module is fully processed and is usable.
|
|
///
|
|
///
|
|
@@ -261,7 +262,7 @@ public:
|
|
/// object.
|
|
/// object.
|
|
/// Is it OK to finalize a set of modules, add modules and finalize again.
|
|
/// Is it OK to finalize a set of modules, add modules and finalize again.
|
|
// FIXME: Do we really need both of these?
|
|
// FIXME: Do we really need both of these?
|
|
- virtual void finalizeObject();
|
|
|
|
|
|
+ void finalizeObject() override;
|
|
virtual void finalizeModule(Module *);
|
|
virtual void finalizeModule(Module *);
|
|
void finalizeLoadedModules();
|
|
void finalizeLoadedModules();
|
|
|
|
|
|
@@ -269,18 +270,18 @@ public:
|
|
/// the static constructors or destructors for a program.
|
|
/// the static constructors or destructors for a program.
|
|
///
|
|
///
|
|
/// \param isDtors - Run the destructors instead of constructors.
|
|
/// \param isDtors - Run the destructors instead of constructors.
|
|
- void runStaticConstructorsDestructors(bool isDtors);
|
|
|
|
|
|
+ void runStaticConstructorsDestructors(bool isDtors) override;
|
|
|
|
|
|
- virtual void *getPointerToBasicBlock(BasicBlock *BB);
|
|
|
|
|
|
+ void *getPointerToBasicBlock(BasicBlock *BB) override;
|
|
|
|
|
|
- virtual void *getPointerToFunction(Function *F);
|
|
|
|
|
|
+ void *getPointerToFunction(Function *F) override;
|
|
|
|
|
|
- virtual void *recompileAndRelinkFunction(Function *F);
|
|
|
|
|
|
+ void *recompileAndRelinkFunction(Function *F) override;
|
|
|
|
|
|
- virtual void freeMachineCodeForFunction(Function *F);
|
|
|
|
|
|
+ void freeMachineCodeForFunction(Function *F) override;
|
|
|
|
|
|
- virtual GenericValue runFunction(Function *F,
|
|
|
|
- const std::vector<GenericValue> &ArgValues);
|
|
|
|
|
|
+ GenericValue runFunction(Function *F,
|
|
|
|
+ const std::vector<GenericValue> &ArgValues) override;
|
|
|
|
|
|
/// getPointerToNamedFunction - This method returns the address of the
|
|
/// getPointerToNamedFunction - This method returns the address of the
|
|
/// specified function by using the dlsym function call. As such it is only
|
|
/// specified function by using the dlsym function call. As such it is only
|
|
@@ -290,27 +291,27 @@ public:
|
|
/// found, this function silently returns a null pointer. Otherwise,
|
|
/// found, this function silently returns a null pointer. Otherwise,
|
|
/// it prints a message to stderr and aborts.
|
|
/// it prints a message to stderr and aborts.
|
|
///
|
|
///
|
|
- virtual void *getPointerToNamedFunction(const std::string &Name,
|
|
|
|
- bool AbortOnFailure = true);
|
|
|
|
|
|
+ void *getPointerToNamedFunction(const std::string &Name,
|
|
|
|
+ bool AbortOnFailure = true) override;
|
|
|
|
|
|
/// mapSectionAddress - map a section to its target address space value.
|
|
/// mapSectionAddress - map a section to its target address space value.
|
|
/// Map the address of a JIT section as returned from the memory manager
|
|
/// Map the address of a JIT section as returned from the memory manager
|
|
/// to the address in the target process as the running code will see it.
|
|
/// to the address in the target process as the running code will see it.
|
|
/// This is the address which will be used for relocation resolution.
|
|
/// This is the address which will be used for relocation resolution.
|
|
- virtual void mapSectionAddress(const void *LocalAddress,
|
|
|
|
- uint64_t TargetAddress) {
|
|
|
|
|
|
+ void mapSectionAddress(const void *LocalAddress,
|
|
|
|
+ uint64_t TargetAddress) override {
|
|
Dyld.mapSectionAddress(LocalAddress, TargetAddress);
|
|
Dyld.mapSectionAddress(LocalAddress, TargetAddress);
|
|
}
|
|
}
|
|
- virtual void RegisterJITEventListener(JITEventListener *L);
|
|
|
|
- virtual void UnregisterJITEventListener(JITEventListener *L);
|
|
|
|
|
|
+ void RegisterJITEventListener(JITEventListener *L) override;
|
|
|
|
+ void UnregisterJITEventListener(JITEventListener *L) override;
|
|
|
|
|
|
// If successful, these function will implicitly finalize all loaded objects.
|
|
// If successful, these function will implicitly finalize all loaded objects.
|
|
// To get a function address within MCJIT without causing a finalize, use
|
|
// To get a function address within MCJIT without causing a finalize, use
|
|
// getSymbolAddress.
|
|
// getSymbolAddress.
|
|
- virtual uint64_t getGlobalValueAddress(const std::string &Name);
|
|
|
|
- virtual uint64_t getFunctionAddress(const std::string &Name);
|
|
|
|
|
|
+ uint64_t getGlobalValueAddress(const std::string &Name) override;
|
|
|
|
+ uint64_t getFunctionAddress(const std::string &Name) override;
|
|
|
|
|
|
- virtual TargetMachine *getTargetMachine() { return TM; }
|
|
|
|
|
|
+ TargetMachine *getTargetMachine() override { return TM; }
|
|
|
|
|
|
/// @}
|
|
/// @}
|
|
/// @name (Private) Registration Interfaces
|
|
/// @name (Private) Registration Interfaces
|