diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-09-03 19:57:35 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-09-03 19:57:35 +0000 |
commit | 3693c29d1c6f500d50ff759d15538114f5b5dbe7 (patch) | |
tree | b8128f51e37dc0d02a847713104c6b3ecb87d6c5 /lib/ExecutionEngine/MCJIT | |
parent | 96a8ccfab758dc18a5ca4b65817b38616925ea00 (diff) |
unique_ptrify MCJIT::emitObject
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217067 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/MCJIT')
-rw-r--r-- | lib/ExecutionEngine/MCJIT/MCJIT.cpp | 8 | ||||
-rw-r--r-- | lib/ExecutionEngine/MCJIT/MCJIT.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/lib/ExecutionEngine/MCJIT/MCJIT.cpp index f6c3c18a4fd..f172b58df47 100644 --- a/lib/ExecutionEngine/MCJIT/MCJIT.cpp +++ b/lib/ExecutionEngine/MCJIT/MCJIT.cpp @@ -123,7 +123,7 @@ void MCJIT::setObjectCache(ObjectCache* NewCache) { ObjCache = NewCache; } -ObjectBufferStream* MCJIT::emitObject(Module *M) { +std::unique_ptr<ObjectBufferStream> MCJIT::emitObject(Module *M) { MutexGuard locked(lock); // This must be a module which has already been added but not loaded to this @@ -159,7 +159,7 @@ ObjectBufferStream* MCJIT::emitObject(Module *M) { ObjCache->notifyObjectCompiled(M, MB); } - return CompiledObject.release(); + return CompiledObject; } void MCJIT::generateCodeForModule(Module *M) { @@ -185,8 +185,8 @@ void MCJIT::generateCodeForModule(Module *M) { // If the cache did not contain a suitable object, compile the object if (!ObjectToLoad) { - ObjectToLoad.reset(emitObject(M)); - assert(ObjectToLoad.get() && "Compilation did not produce an object."); + ObjectToLoad = emitObject(M); + assert(ObjectToLoad && "Compilation did not produce an object."); } // Load the object into the dynamic linker. diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.h b/lib/ExecutionEngine/MCJIT/MCJIT.h index d52a7322eb3..9a4e53f27f2 100644 --- a/lib/ExecutionEngine/MCJIT/MCJIT.h +++ b/lib/ExecutionEngine/MCJIT/MCJIT.h @@ -338,7 +338,7 @@ protected: /// this function call is expected to be the contained module. The module /// is passed as a parameter here to prepare for multiple module support in /// the future. - ObjectBufferStream* emitObject(Module *M); + std::unique_ptr<ObjectBufferStream> emitObject(Module *M); void NotifyObjectEmitted(const ObjectImage& Obj); void NotifyFreeingObject(const ObjectImage& Obj); |