diff options
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp')
-rw-r--r-- | lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp index 202c3ca1c507..9ca76602ea18 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp @@ -233,7 +233,10 @@ RuntimeDyldMachOCRTPBase<Impl>::finalizeLoad(const ObjectFile &Obj, for (const auto &Section : Obj.sections()) { StringRef Name; - Section.getName(Name); + if (Expected<StringRef> NameOrErr = Section.getName()) + Name = *NameOrErr; + else + consumeError(NameOrErr.takeError()); // Force emission of the __text, __eh_frame, and __gcc_except_tab sections // if they're present. Otherwise call down to the impl to handle other @@ -351,20 +354,22 @@ RuntimeDyldMachO::create(Triple::ArchType Arch, llvm_unreachable("Unsupported target for RuntimeDyldMachO."); break; case Triple::arm: - return make_unique<RuntimeDyldMachOARM>(MemMgr, Resolver); + return std::make_unique<RuntimeDyldMachOARM>(MemMgr, Resolver); case Triple::aarch64: - return make_unique<RuntimeDyldMachOAArch64>(MemMgr, Resolver); + return std::make_unique<RuntimeDyldMachOAArch64>(MemMgr, Resolver); + case Triple::aarch64_32: + return std::make_unique<RuntimeDyldMachOAArch64>(MemMgr, Resolver); case Triple::x86: - return make_unique<RuntimeDyldMachOI386>(MemMgr, Resolver); + return std::make_unique<RuntimeDyldMachOI386>(MemMgr, Resolver); case Triple::x86_64: - return make_unique<RuntimeDyldMachOX86_64>(MemMgr, Resolver); + return std::make_unique<RuntimeDyldMachOX86_64>(MemMgr, Resolver); } } std::unique_ptr<RuntimeDyld::LoadedObjectInfo> RuntimeDyldMachO::loadObject(const object::ObjectFile &O) { if (auto ObjSectionToIDOrErr = loadObjectImpl(O)) - return llvm::make_unique<LoadedMachOObjectInfo>(*this, + return std::make_unique<LoadedMachOObjectInfo>(*this, *ObjSectionToIDOrErr); else { HasError = true; |