Revising the MCJIT ObjectCache interface to allow subclasses to avoid retaining references to returned objects

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185221 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Andrew Kaylor
2013-06-28 21:40:16 +00:00
parent 75f29256f3
commit 40d8171e3e
3 changed files with 14 additions and 25 deletions

View File

@@ -129,7 +129,7 @@ void MCJIT::loadObject(Module *M) {
OwningPtr<ObjectBuffer> ObjectToLoad;
// Try to load the pre-compiled object from cache if possible
if (0 != ObjCache) {
OwningPtr<MemoryBuffer> PreCompiledObject(ObjCache->getObjectCopy(M));
OwningPtr<MemoryBuffer> PreCompiledObject(ObjCache->getObject(M));
if (0 != PreCompiledObject.get())
ObjectToLoad.reset(new ObjectBuffer(PreCompiledObject.take()));
}