mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-22 10:24:26 +00:00
Give ExecutionEngine of top level buffers.
Long term the idea if for the engine to not own the buffers, but for now this is consistent with the rest of the API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216484 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -124,6 +124,11 @@ void ExecutionEngine::addObjectFile(std::unique_ptr<object::ObjectFile> O) {
|
||||
llvm_unreachable("ExecutionEngine subclass doesn't implement addObjectFile.");
|
||||
}
|
||||
|
||||
void
|
||||
ExecutionEngine::addObjectFile(object::OwningBinary<object::ObjectFile> O) {
|
||||
llvm_unreachable("ExecutionEngine subclass doesn't implement addObjectFile.");
|
||||
}
|
||||
|
||||
void ExecutionEngine::addArchive(object::OwningBinary<object::Archive> A) {
|
||||
llvm_unreachable("ExecutionEngine subclass doesn't implement addArchive.");
|
||||
}
|
||||
|
@ -107,8 +107,6 @@ bool MCJIT::removeModule(Module *M) {
|
||||
return OwnedModules.removeModule(M);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MCJIT::addObjectFile(std::unique_ptr<object::ObjectFile> Obj) {
|
||||
ObjectImage *LoadedObject = Dyld.loadObject(std::move(Obj));
|
||||
if (!LoadedObject || Dyld.hasError())
|
||||
@ -119,11 +117,15 @@ void MCJIT::addObjectFile(std::unique_ptr<object::ObjectFile> Obj) {
|
||||
NotifyObjectEmitted(*LoadedObject);
|
||||
}
|
||||
|
||||
void MCJIT::addObjectFile(object::OwningBinary<object::ObjectFile> Obj) {
|
||||
addObjectFile(std::move(Obj.getBinary()));
|
||||
Buffers.push_back(std::move(Obj.getBuffer()));
|
||||
}
|
||||
|
||||
void MCJIT::addArchive(object::OwningBinary<object::Archive> A) {
|
||||
Archives.push_back(std::move(A));
|
||||
}
|
||||
|
||||
|
||||
void MCJIT::setObjectCache(ObjectCache* NewCache) {
|
||||
MutexGuard locked(lock);
|
||||
ObjCache = NewCache;
|
||||
|
@ -217,6 +217,7 @@ class MCJIT : public ExecutionEngine {
|
||||
OwningModuleContainer OwnedModules;
|
||||
|
||||
SmallVector<object::OwningBinary<object::Archive>, 2> Archives;
|
||||
SmallVector<std::unique_ptr<MemoryBuffer>, 2> Buffers;
|
||||
|
||||
typedef SmallVector<ObjectImage *, 2> LoadedObjectList;
|
||||
LoadedObjectList LoadedObjects;
|
||||
@ -240,6 +241,7 @@ public:
|
||||
/// @{
|
||||
void addModule(std::unique_ptr<Module> M) override;
|
||||
void addObjectFile(std::unique_ptr<object::ObjectFile> O) override;
|
||||
void addObjectFile(object::OwningBinary<object::ObjectFile> O) override;
|
||||
void addArchive(object::OwningBinary<object::Archive> O) override;
|
||||
bool removeModule(Module *M) override;
|
||||
|
||||
|
Reference in New Issue
Block a user