1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

unique_ptrify RuntimeDyld::Dyld

llvm-svn: 217180
This commit is contained in:
David Blaikie 2014-09-04 18:37:29 +00:00
parent b2519b0989
commit 2824fa8c01
2 changed files with 8 additions and 8 deletions

View File

@ -37,7 +37,7 @@ class RuntimeDyld {
// RuntimeDyldImpl is the actual class. RuntimeDyld is just the public
// interface.
RuntimeDyldImpl *Dyld;
std::unique_ptr<RuntimeDyldImpl> Dyld;
RTDyldMemoryManager *MM;
bool ProcessAllSections;
RuntimeDyldCheckerImpl *Checker;

View File

@ -778,7 +778,7 @@ RuntimeDyld::RuntimeDyld(RTDyldMemoryManager *mm) {
Checker = nullptr;
}
RuntimeDyld::~RuntimeDyld() { delete Dyld; }
RuntimeDyld::~RuntimeDyld() {}
static std::unique_ptr<RuntimeDyldELF>
createRuntimeDyldELF(RTDyldMemoryManager *MM, bool ProcessAllSections,
@ -807,13 +807,13 @@ RuntimeDyld::loadObject(std::unique_ptr<ObjectFile> InputObject) {
if (InputObject->isELF()) {
InputImage.reset(RuntimeDyldELF::createObjectImageFromFile(std::move(InputObject)));
if (!Dyld)
Dyld = createRuntimeDyldELF(MM, ProcessAllSections, Checker).release();
Dyld = createRuntimeDyldELF(MM, ProcessAllSections, Checker);
} else if (InputObject->isMachO()) {
InputImage.reset(RuntimeDyldMachO::createObjectImageFromFile(std::move(InputObject)));
if (!Dyld)
Dyld = createRuntimeDyldMachO(
static_cast<Triple::ArchType>(InputImage->getArch()),
MM, ProcessAllSections, Checker).release();
static_cast<Triple::ArchType>(InputImage->getArch()), MM,
ProcessAllSections, Checker);
} else
report_fatal_error("Incompatible object format!");
@ -836,7 +836,7 @@ RuntimeDyld::loadObject(std::unique_ptr<ObjectBuffer> InputBuffer) {
case sys::fs::file_magic::elf_core:
InputImage = RuntimeDyldELF::createObjectImage(std::move(InputBuffer));
if (!Dyld)
Dyld = createRuntimeDyldELF(MM, ProcessAllSections, Checker).release();
Dyld = createRuntimeDyldELF(MM, ProcessAllSections, Checker);
break;
case sys::fs::file_magic::macho_object:
case sys::fs::file_magic::macho_executable:
@ -851,8 +851,8 @@ RuntimeDyld::loadObject(std::unique_ptr<ObjectBuffer> InputBuffer) {
InputImage = RuntimeDyldMachO::createObjectImage(std::move(InputBuffer));
if (!Dyld)
Dyld = createRuntimeDyldMachO(
static_cast<Triple::ArchType>(InputImage->getArch()),
MM, ProcessAllSections, Checker).release();
static_cast<Triple::ArchType>(InputImage->getArch()), MM,
ProcessAllSections, Checker);
break;
case sys::fs::file_magic::unknown:
case sys::fs::file_magic::bitcode: