mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
unique_ptrify MCJIT::emitObject
llvm-svn: 217067
This commit is contained in:
parent
981acfbd5e
commit
8772427720
@ -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.
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user