diff options
36 files changed, 105 insertions, 105 deletions
diff --git a/lld/include/lld/Core/InputGraph.h b/lld/include/lld/Core/InputGraph.h index 058bf920665..20a91d0b521 100644 --- a/lld/include/lld/Core/InputGraph.h +++ b/lld/include/lld/Core/InputGraph.h @@ -188,7 +188,7 @@ public: for (std::unique_ptr<InputElement> &ei : _elements) if (error_code ec = ei->parse(ctx, diag)) return ec; - return error_code::success(); + return error_code(); } /// If Resolver made a progress using the current file, it's ok to revisit @@ -290,7 +290,7 @@ public: /// \brief parse the input element error_code parse(const LinkingContext &, raw_ostream &) override { - return error_code::success(); + return error_code(); } /// \brief Return the next File thats part of this node to the diff --git a/lld/include/lld/Driver/DarwinInputGraph.h b/lld/include/lld/Driver/DarwinInputGraph.h index e9184348854..0e74aeca5bd 100644 --- a/lld/include/lld/Driver/DarwinInputGraph.h +++ b/lld/include/lld/Driver/DarwinInputGraph.h @@ -58,7 +58,7 @@ public: } else { // if --whole-archive is around non-archive, just use it as normal. _files.push_back(std::move(f)); - return error_code::success(); + return error_code(); } } return ctx.registry().parseFile(_buffer, _files); diff --git a/lld/lib/Core/InputGraph.cpp b/lld/lib/Core/InputGraph.cpp index abd3385ad6b..eee6faf691e 100644 --- a/lld/lib/Core/InputGraph.cpp +++ b/lld/lib/Core/InputGraph.cpp @@ -90,7 +90,7 @@ error_code FileNode::getBuffer(StringRef filePath) { if (error_code ec = MemoryBuffer::getFileOrSTDIN(filePath, mb)) return ec; _buffer = std::move(mb); - return error_code::success(); + return error_code(); } /// \brief Return the next file that need to be processed by the resolver. diff --git a/lld/lib/Core/PassManager.cpp b/lld/lib/Core/PassManager.cpp index c46146122a0..eca7ce171ab 100644 --- a/lld/lib/Core/PassManager.cpp +++ b/lld/lib/Core/PassManager.cpp @@ -18,6 +18,6 @@ namespace lld { error_code PassManager::runOnFile(std::unique_ptr<MutableFile> &mf) { for (std::unique_ptr<Pass> &pass : _passes) pass->perform(mf); - return error_code::success(); + return error_code(); } } // end namespace lld diff --git a/lld/lib/Driver/GnuLdDriver.cpp b/lld/lib/Driver/GnuLdDriver.cpp index 9f18d5723b1..ef5bfa8458c 100644 --- a/lld/lib/Driver/GnuLdDriver.cpp +++ b/lld/lib/Driver/GnuLdDriver.cpp @@ -122,7 +122,7 @@ static error_code getFileMagic(ELFLinkingContext &ctx, StringRef path, case llvm::sys::fs::file_magic::elf_relocatable: case llvm::sys::fs::file_magic::elf_shared_object: case llvm::sys::fs::file_magic::unknown: - return error_code::success(); + return error_code(); default: break; } diff --git a/lld/lib/Driver/GnuLdInputGraph.cpp b/lld/lib/Driver/GnuLdInputGraph.cpp index fd806065b0b..a3c6543e125 100644 --- a/lld/lib/Driver/GnuLdInputGraph.cpp +++ b/lld/lib/Driver/GnuLdInputGraph.cpp @@ -41,7 +41,7 @@ error_code ELFFileNode::parse(const LinkingContext &ctx, } // if --whole-archive is around non-archive, just use it as normal. _files.push_back(std::move(f)); - return error_code::success(); + return error_code(); } return ctx.registry().parseFile(_buffer, _files); } @@ -66,7 +66,7 @@ error_code GNULdScript::parse(const LinkingContext &ctx, if (!_linkerScript) return LinkerScriptReaderError::parse_error; - return error_code::success(); + return error_code(); } static bool isPathUnderSysroot(StringRef sysroot, StringRef path) { @@ -106,5 +106,5 @@ error_code ELFGNULdScript::parse(const LinkingContext &ctx, } _expandElements.push_back(std::move(groupStart)); } - return error_code::success(); + return error_code(); } diff --git a/lld/lib/Driver/WinLinkInputGraph.cpp b/lld/lib/Driver/WinLinkInputGraph.cpp index 918ea58632c..fd6f5b574d4 100644 --- a/lld/lib/Driver/WinLinkInputGraph.cpp +++ b/lld/lib/Driver/WinLinkInputGraph.cpp @@ -19,7 +19,7 @@ bool isCOFFLibraryFileExtension(StringRef path) { error_code PECOFFFileNode::parse(const LinkingContext &ctx, raw_ostream &diagnostics) { if (_parsed) - return error_code::success(); + return error_code(); _parsed = true; ErrorOr<StringRef> filePath = getPath(ctx); if (error_code ec = filePath.getError()) { diff --git a/lld/lib/ReaderWriter/ELF/ELFFile.h b/lld/lib/ReaderWriter/ELF/ELFFile.h index 4e630094b29..65cc8944dac 100644 --- a/lld/lib/ReaderWriter/ELF/ELFFile.h +++ b/lld/lib/ReaderWriter/ELF/ELFFile.h @@ -509,7 +509,7 @@ template <class ELFT> error_code ELFFile<ELFT>::createAtomizableSections() { } } _references.reserve(totalRelocs); - return error_code::success(); + return error_code(); } template <class ELFT> error_code ELFFile<ELFT>::createMergeableAtoms() { @@ -550,7 +550,7 @@ template <class ELFT> error_code ELFFile<ELFT>::createMergeableAtoms() { _definedAtoms._atoms.push_back(*mergeAtom); _mergeAtoms.push_back(*mergeAtom); } - return error_code::success(); + return error_code(); } template <class ELFT> @@ -594,7 +594,7 @@ error_code ELFFile<ELFT>::createSymbolsFromAtomizableSections() { } } - return error_code::success(); + return error_code(); } template <class ELFT> error_code ELFFile<ELFT>::createAtoms() { @@ -736,7 +736,7 @@ template <class ELFT> error_code ELFFile<ELFT>::createAtoms() { } updateReferences(); - return error_code::success(); + return error_code(); } template <class ELFT> diff --git a/lld/lib/ReaderWriter/ELF/ELFReader.h b/lld/lib/ReaderWriter/ELF/ELFReader.h index ecf9741999c..932649e14bd 100644 --- a/lld/lib/ReaderWriter/ELF/ELFReader.h +++ b/lld/lib/ReaderWriter/ELF/ELFReader.h @@ -59,7 +59,7 @@ public: if (error_code ec = f.getError()) return ec; result.push_back(std::move(*f)); - return error_code::success(); + return error_code(); } protected: @@ -86,7 +86,7 @@ public: if (error_code ec = f.getError()) return ec; result.push_back(std::move(*f)); - return error_code::success(); + return error_code(); } protected: diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h index 0cbb96e7a77..34e517adb00 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h @@ -34,7 +34,7 @@ protected: virtual error_code setELFHeader() { DynamicLibraryWriter<ELFT>::setELFHeader(); HexagonELFWriter<ELFT>::setELFHeader(*this->_elfHeader); - return error_code::success(); + return error_code(); } private: diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h index 9dda08aaf06..d99a74f9d05 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h @@ -54,7 +54,7 @@ public: if (error_code ec = f.getError()) return ec; result.push_back(std::move(*f)); - return error_code::success(); + return error_code(); } }; @@ -73,7 +73,7 @@ public: if (error_code ec = f.getError()) return ec; result.push_back(std::move(*f)); - return error_code::success(); + return error_code(); } }; diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h index 291b2d6fb8a..b00091a5e6b 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h @@ -35,7 +35,7 @@ protected: virtual error_code setELFHeader() { ExecutableWriter<ELFT>::setELFHeader(); HexagonELFWriter<ELFT>::setELFHeader(*this->_elfHeader); - return error_code::success(); + return error_code(); } private: diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp index 22f10f7f74b..89402eadf29 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp @@ -220,7 +220,7 @@ error_code HexagonTargetRelocationHandler::applyRelocation( uint64_t relocVAddress = atom._virtualAddr + ref.offsetInAtom(); if (ref.kindNamespace() != Reference::KindNamespace::ELF) - return error_code::success(); + return error_code(); assert(ref.kindArch() == Reference::KindArch::Hexagon); switch (ref.kindValue()) { case R_HEX_B22_PCREL: @@ -353,7 +353,7 @@ error_code HexagonTargetRelocationHandler::applyRelocation( } } - return error_code::success(); + return error_code(); } diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp index 7f7a855f0b9..58f3f731609 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp @@ -304,7 +304,7 @@ public: error_code handleGOTREL(const Reference &ref) { // Turn this so that the target is set to the GOT entry const_cast<Reference &>(ref).setTarget(getGOTEntry(ref.target())); - return error_code::success(); + return error_code(); } error_code handlePLT32(const Reference &ref) { @@ -313,7 +313,7 @@ public: assert(ref.kindArch() == Reference::KindArch::Hexagon); const_cast<Reference &>(ref).setKindValue(R_HEX_B22_PCREL); const_cast<Reference &>(ref).setTarget(getPLTEntry(ref.target())); - return error_code::success(); + return error_code(); } }; diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h b/lld/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h index ed889db0715..f1e47e7ee31 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h @@ -34,7 +34,7 @@ protected: error_code setELFHeader() override { DynamicLibraryWriter<ELFT>::setELFHeader(); _writeHelper.setELFHeader(*this->_elfHeader); - return error_code::success(); + return error_code(); } LLD_UNIQUE_BUMP_PTR(DynamicTable<ELFT>) createDynamicTable(); diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsELFFile.h b/lld/lib/ReaderWriter/ELF/Mips/MipsELFFile.h index f908d12629c..afdfc11ebe4 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsELFFile.h +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsELFFile.h @@ -158,7 +158,7 @@ private: } else if (!_tpOff.hasValue() && section.sh_flags & llvm::ELF::SHF_TLS) _tpOff = section.sh_addr + TP_OFFSET; } - return error_code::success(); + return error_code(); } void createRelocationReferences(const Elf_Sym &symbol, diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsELFReader.h b/lld/lib/ReaderWriter/ELF/Mips/MipsELFReader.h index a03d60530eb..f58332f52a5 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsELFReader.h +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsELFReader.h @@ -40,7 +40,7 @@ public: if (error_code ec = f.getError()) return ec; result.push_back(std::move(*f)); - return error_code::success(); + return error_code(); } }; diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h b/lld/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h index 27997f636df..65034d279e5 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h @@ -36,7 +36,7 @@ protected: error_code setELFHeader() override { ExecutableWriter<ELFT>::setELFHeader(); _writeHelper.setELFHeader(*this->_elfHeader); - return error_code::success(); + return error_code(); } LLD_UNIQUE_BUMP_PTR(DynamicTable<ELFT>) createDynamicTable(); diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp index ce9204132b6..a1e0ea36237 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp @@ -123,7 +123,7 @@ error_code MipsTargetRelocationHandler::applyRelocation( ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom, const Reference &ref) const { if (ref.kindNamespace() != lld::Reference::KindNamespace::ELF) - return error_code::success(); + return error_code(); assert(ref.kindArch() == Reference::KindArch::Mips); AtomLayout *gpAtom = _mipsTargetLayout.getGP(); @@ -204,5 +204,5 @@ error_code MipsTargetRelocationHandler::applyRelocation( } } - return error_code::success(); + return error_code(); } diff --git a/lld/lib/ReaderWriter/ELF/OutputELFWriter.h b/lld/lib/ReaderWriter/ELF/OutputELFWriter.h index 75f588237fb..394695e6f75 100644 --- a/lld/lib/ReaderWriter/ELF/OutputELFWriter.h +++ b/lld/lib/ReaderWriter/ELF/OutputELFWriter.h @@ -394,7 +394,7 @@ error_code OutputELFWriter<ELFT>::buildOutput(const File &file) { if (_context.isDynamic()) _dynamicTable->updateDynamicTable(); - return error_code::success(); + return error_code(); } template <class ELFT> error_code OutputELFWriter<ELFT>::setELFHeader() { @@ -419,7 +419,7 @@ template <class ELFT> error_code OutputELFWriter<ELFT>::setELFHeader() { _layout.findAtomAddrByName(_context.entrySymbolName(), virtualAddr); _elfHeader->e_entry(virtualAddr); - return error_code::success(); + return error_code(); } template <class ELFT> uint64_t OutputELFWriter<ELFT>::outputFileSize() const { diff --git a/lld/lib/ReaderWriter/ELF/PPC/PPCELFReader.h b/lld/lib/ReaderWriter/ELF/PPC/PPCELFReader.h index 41d95f31615..159b6da1d6f 100644 --- a/lld/lib/ReaderWriter/ELF/PPC/PPCELFReader.h +++ b/lld/lib/ReaderWriter/ELF/PPC/PPCELFReader.h @@ -52,7 +52,7 @@ public: if (!f) return f; result.push_back(std::move(*f)); - return error_code::success(); + return error_code(); } }; @@ -71,7 +71,7 @@ public: if (!f) return f; result.push_back(std::move(*f)); - return error_code::success(); + return error_code(); } }; diff --git a/lld/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp b/lld/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp index 8f05bb9b6bc..f76b169da84 100644 --- a/lld/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp @@ -44,7 +44,7 @@ error_code PPCTargetRelocationHandler::applyRelocation( uint64_t relocVAddress = atom._virtualAddr + ref.offsetInAtom(); if (ref.kindNamespace() != Reference::KindNamespace::ELF) - return error_code::success(); + return error_code(); assert(ref.kindArch() == Reference::KindArch::PowerPC); switch (ref.kindValue()) { case R_PPC_REL24: @@ -60,7 +60,7 @@ error_code PPCTargetRelocationHandler::applyRelocation( } } - return error_code::success(); + return error_code(); } PPCTargetHandler::PPCTargetHandler(PPCLinkingContext &context) diff --git a/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp b/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp index 367b4d8073d..25ad7a805d6 100644 --- a/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp @@ -105,7 +105,7 @@ error_code X86TargetRelocationHandler::applyRelocation( uint64_t relocVAddress = atom._virtualAddr + ref.offsetInAtom(); if (ref.kindNamespace() != Reference::KindNamespace::ELF) - return error_code::success(); + return error_code(); assert(ref.kindArch() == Reference::KindArch::x86); switch (ref.kindValue()) { case R_386_32: @@ -123,7 +123,7 @@ error_code X86TargetRelocationHandler::applyRelocation( } } - return error_code::success(); + return error_code(); } X86TargetHandler::X86TargetHandler(X86LinkingContext &context) diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp index 750b9d1bd73..1b800a58264 100644 --- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp @@ -69,7 +69,7 @@ error_code X86_64TargetRelocationHandler::applyRelocation( uint64_t relocVAddress = atom._virtualAddr + ref.offsetInAtom(); if (ref.kindNamespace() != Reference::KindNamespace::ELF) - return error_code::success(); + return error_code(); assert(ref.kindArch() == Reference::KindArch::x86_64); switch (ref.kindValue()) { case R_X86_64_NONE: @@ -140,5 +140,5 @@ error_code X86_64TargetRelocationHandler::applyRelocation( } } - return error_code::success(); + return error_code(); } diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp index e108751a948..f03b5be52ef 100644 --- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp +++ b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp @@ -153,7 +153,7 @@ protected: auto target = dyn_cast_or_null<const DefinedAtom>(ref.target()); if (target && target->contentType() == DefinedAtom::typeResolver) const_cast<Reference &>(ref).setTarget(getIFUNCPLTEntry(target)); - return error_code::success(); + return error_code(); } /// \brief Create a GOT entry for the TP offset of a TLS atom. @@ -306,7 +306,7 @@ public: // __tls_get_addr is handled elsewhere. if (ref.target() && ref.target()->name() == "__tls_get_addr") { const_cast<Reference &>(ref).setKindValue(R_X86_64_NONE); - return error_code::success(); + return error_code(); } // Static code doesn't need PLTs. const_cast<Reference &>(ref).setKindValue(R_X86_64_PC32); @@ -315,7 +315,7 @@ public: dyn_cast_or_null<const DefinedAtom>(ref.target())) if (da->contentType() == DefinedAtom::typeResolver) return handleIFUNC(ref); - return error_code::success(); + return error_code(); } error_code handleGOT(const Reference &ref) { @@ -323,7 +323,7 @@ public: const_cast<Reference &>(ref).setTarget(getNullGOT()); else if (const DefinedAtom *da = dyn_cast<const DefinedAtom>(ref.target())) const_cast<Reference &>(ref).setTarget(getGOT(da)); - return error_code::success(); + return error_code(); } }; @@ -395,7 +395,7 @@ public: error_code handlePlain(const Reference &ref) { if (!ref.target()) - return error_code::success(); + return error_code(); if (auto sla = dyn_cast<SharedLibraryAtom>(ref.target())) { if (sla->type() == SharedLibraryAtom::Type::Data) const_cast<Reference &>(ref).setTarget(getObjectEntry(sla)); @@ -403,7 +403,7 @@ public: const_cast<Reference &>(ref).setTarget(getPLTEntry(sla)); } else return handleIFUNC(ref); - return error_code::success(); + return error_code(); } error_code handlePLT32(const Reference &ref) { @@ -416,7 +416,7 @@ public: return handleIFUNC(ref); if (isa<const SharedLibraryAtom>(ref.target())) const_cast<Reference &>(ref).setTarget(getPLTEntry(ref.target())); - return error_code::success(); + return error_code(); } const GOTAtom *getSharedGOT(const SharedLibraryAtom *sla) { @@ -442,7 +442,7 @@ public: const_cast<Reference &>(ref).setTarget(getGOT(da)); else if (const auto sla = dyn_cast<const SharedLibraryAtom>(ref.target())) const_cast<Reference &>(ref).setTarget(getSharedGOT(sla)); - return error_code::success(); + return error_code(); } }; } // end anon namespace diff --git a/lld/lib/ReaderWriter/FileArchive.cpp b/lld/lib/ReaderWriter/FileArchive.cpp index 086e9094288..140d43e7dc2 100644 --- a/lld/lib/ReaderWriter/FileArchive.cpp +++ b/lld/lib/ReaderWriter/FileArchive.cpp @@ -78,7 +78,7 @@ public: if (error_code ec = instantiateMember(mf, result)) return ec; } - return error_code::success(); + return error_code(); } const atom_collection<DefinedAtom> &defined() const override { @@ -117,7 +117,7 @@ protected: _registry.parseFile(mb, result); const char *memberStart = member->getBuffer().data(); _membersInstantiated.insert(memberStart); - return error_code::success(); + return error_code(); } error_code isDataSymbol(std::unique_ptr<MemoryBuffer> mb, StringRef symbol) const { @@ -152,7 +152,7 @@ protected: return ec; if (symtype == SymbolRef::ST_Data) { - return error_code::success(); + return error_code(); } } return object_error::parse_failed; @@ -199,7 +199,7 @@ public: << "'" << name << "'\n"); _symbolMemberMap[name] = member; } - return error_code::success(); + return error_code(); } }; // class FileArchive @@ -233,7 +233,7 @@ public: mb.release(); result.push_back(std::move(file)); - return error_code::success(); + return error_code(); } private: diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp index bb1b5dd107d..ce10867c5b7 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp @@ -68,12 +68,12 @@ forEachLoadCommand(StringRef lcRange, unsigned lcCount, bool swap, bool is64, return llvm::make_error_code(llvm::errc::executable_format_error); if (func(slc->cmd, slc->cmdsize, p)) - return error_code::success(); + return error_code(); p += slc->cmdsize; } - return error_code::success(); + return error_code(); } @@ -88,7 +88,7 @@ appendRelocations(Relocations &relocs, StringRef buffer, bool swap, for(uint32_t i=0; i < nreloc; ++i) { relocs.push_back(unpackRelocation(relocsArray[i], swap, bigEndian)); } - return error_code::success(); + return error_code(); } static error_code @@ -105,7 +105,7 @@ appendIndirectSymbols(IndirectSymbols &isyms, StringRef buffer, bool swap, for(uint32_t i=0; i < count; ++i) { isyms.push_back(read32(swap, indirectSymbolArray[startIndex+i])); } - return error_code::success(); + return error_code(); } @@ -426,7 +426,7 @@ public: result.push_back(std::move(*file)); - return error_code::success(); + return error_code(); } private: MachOLinkingContext::Arch _arch; diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp index 10123196a57..4a39a4bad27 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp @@ -524,7 +524,7 @@ error_code MachOFileLayout::writeSingleSegmentLoadCommand(uint8_t *&lc) { ++sout; } lc = next; - return error_code::success(); + return error_code(); } @@ -587,7 +587,7 @@ error_code MachOFileLayout::writeSegmentLoadCommands(uint8_t *&lc) { if (_swap) swapStruct(*cmd); lc = next; - return error_code::success(); + return error_code(); } @@ -954,7 +954,7 @@ error_code MachOFileLayout::writeBinary(StringRef path) { writeLinkEditContent(); fob->commit(); - return error_code::success(); + return error_code(); } diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp index 4f2edbc4a45..a81c74be29b 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp @@ -120,7 +120,7 @@ processSymbol(const NormalizedFile &normalizedFile, MachOFile &file, case symbolsOk: break; case symbolsIgnored: - return error_code::success(); + return error_code(); break; case symbolsIllegal: return make_dynamic_error_code(Twine("Symbol '") + sym.name @@ -155,7 +155,7 @@ processSymbol(const NormalizedFile &normalizedFile, MachOFile &file, copyRefs); } } - return error_code::success(); + return error_code(); } @@ -198,7 +198,7 @@ static error_code processUTF16Section(MachOFile &file, const Section §ion, "last string in the section is not zero " "terminated."); } - return error_code::success(); + return error_code(); } // A __DATA/__cfstring section contain NS/CFString objects. Atom boundaries @@ -220,7 +220,7 @@ static error_code processCFStringSection(MachOFile &file,const Section §ion, DefinedAtom::mergeByContent, byteContent, copyRefs); offset += cfsObjSize; } - return error_code::success(); + return error_code(); } @@ -254,7 +254,7 @@ static error_code processCFISection(MachOFile &file, const Section §ion, bytes, copyRefs); offset += len; } - return error_code::success(); + return error_code(); } static error_code @@ -275,7 +275,7 @@ processCompactUnwindSection(MachOFile &file, const Section §ion, DefinedAtom::mergeNo, byteContent, copyRefs); offset += cuObjSize; } - return error_code::success(); + return error_code(); } static error_code processSection(MachOFile &file, const Section §ion, @@ -437,7 +437,7 @@ static error_code processSection(MachOFile &file, const Section §ion, llvm_unreachable("mach-o section type not supported yet"); break; } - return error_code::success(); + return error_code(); } static ErrorOr<std::unique_ptr<lld::File>> diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp index 4ce61fc9cb9..d792975dc71 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp @@ -706,7 +706,7 @@ writeYaml(const NormalizedFile &file, raw_ostream &out) { // Stream out yaml. yout << *f; - return error_code::success(); + return error_code(); } } // namespace normalized diff --git a/lld/lib/ReaderWriter/Native/ReaderNative.cpp b/lld/lib/ReaderWriter/Native/ReaderNative.cpp index 9b8a749aee2..e6871aea7d4 100644 --- a/lld/lib/ReaderWriter/Native/ReaderNative.cpp +++ b/lld/lib/ReaderWriter/Native/ReaderNative.cpp @@ -1009,7 +1009,7 @@ public: parseFile(std::unique_ptr<MemoryBuffer> &mb, const class Registry &, std::vector<std::unique_ptr<File>> &result) const override { return lld::native::File::make(std::move(mb), result); - return error_code::success(); + return error_code(); } }; } diff --git a/lld/lib/ReaderWriter/Native/WriterNative.cpp b/lld/lib/ReaderWriter/Native/WriterNative.cpp index 80f50e866f4..fe7bf7fa131 100644 --- a/lld/lib/ReaderWriter/Native/WriterNative.cpp +++ b/lld/lib/ReaderWriter/Native/WriterNative.cpp @@ -73,11 +73,11 @@ public: llvm::raw_fd_ostream out(outPath.data(), errorInfo, llvm::sys::fs::F_None); if (!errorInfo.empty()) - return error_code::success(); // FIXME + return error_code(); // FIXME this->write(out); - return error_code::success(); + return error_code(); } virtual ~Writer() { diff --git a/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h b/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h index d924c42d832..d8f77581a18 100644 --- a/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h +++ b/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h @@ -78,7 +78,7 @@ public: error_code parseAllMembers(std::vector<std::unique_ptr<File>> &result) const override { - return error_code::success(); + return error_code(); } private: diff --git a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp index 19a5509ee34..43dee442a43 100644 --- a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp +++ b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp @@ -318,7 +318,7 @@ error_code FileCOFF::parse() { return ec; if (error_code ec = maybeCreateSXDataAtoms()) return ec; - return error_code::success(); + return error_code(); } /// Iterate over the symbol table to retrieve all symbols. @@ -364,7 +364,7 @@ error_code FileCOFF::readSymbolTable(vector<const coff_symbol *> &result) { next: i += sym->NumberOfAuxSymbols; } - return error_code::success(); + return error_code(); } /// Create atoms for the absolute symbols. @@ -436,7 +436,7 @@ FileCOFF::createUndefinedAtoms(const SymbolVectorT &symbols, result.push_back(atom); _symbolAtom[sym] = atom; } - return error_code::success(); + return error_code(); } /// Create atoms for the defined symbols. This pass is a bit complicated than @@ -526,7 +526,7 @@ error_code FileCOFF::createDefinedSymbols(const SymbolVectorT &symbols, if (error_code ec = AtomizeDefinedSymbols(definedSymbols, result)) return ec; - return error_code::success(); + return error_code(); } // Cache the COMDAT attributes, which indicate whether the symbols in the @@ -567,7 +567,7 @@ error_code FileCOFF::cacheSectionAttributes() { if (!_merge.count(sec)) _merge[sec] = DefinedAtom::mergeNo; } - return error_code::success(); + return error_code(); } /// Atomize \p symbols and append the results to \p atoms. The symbols are @@ -603,7 +603,7 @@ FileCOFF::AtomizeDefinedSymbolsInSection(const coff_section *section, atoms.push_back(atom); _symbolAtom[sym] = atom; } - return error_code::success(); + return error_code(); } ArrayRef<uint8_t> secData; @@ -614,7 +614,7 @@ FileCOFF::AtomizeDefinedSymbolsInSection(const coff_section *section, // a part of the output image. That's what the COFF spec says. if (section->Characteristics & llvm::COFF::IMAGE_SCN_LNK_INFO || section->Characteristics & llvm::COFF::IMAGE_SCN_LNK_REMOVE) - return error_code::success(); + return error_code(); // Supporting debug info needs more work than just linking and combining // .debug sections. We don't support it yet. Let's discard .debug sections at @@ -622,7 +622,7 @@ FileCOFF::AtomizeDefinedSymbolsInSection(const coff_section *section, // blobs that nobody would understand. if ((section->Characteristics & llvm::COFF::IMAGE_SCN_MEM_DISCARDABLE) && (sectionName == ".debug" || sectionName.startswith(".debug$"))) { - return error_code::success(); + return error_code(); } DefinedAtom::ContentType type = getContentType(section); @@ -637,7 +637,7 @@ FileCOFF::AtomizeDefinedSymbolsInSection(const coff_section *section, perms, _merge[section], data, _ordinal++); atoms.push_back(atom); _definedAtomLocations[section][0].push_back(atom); - return error_code::success(); + return error_code(); } // Create an unnamed atom if the first atom isn't at the start of the @@ -669,7 +669,7 @@ FileCOFF::AtomizeDefinedSymbolsInSection(const coff_section *section, // Finally, set alignment to the first atom so that the section contents // will be aligned as specified by the object section header. _definedAtomLocations[section][0][0]->setAlignment(getAlignment(section)); - return error_code::success(); + return error_code(); } error_code @@ -692,7 +692,7 @@ FileCOFF::AtomizeDefinedSymbols(SectionToSymbolsT &definedSymbols, definedAtoms.push_back(atom); } } - return error_code::success(); + return error_code(); } /// Find the atom that is at \p targetAddress in \p section. @@ -708,7 +708,7 @@ error_code FileCOFF::findAtomAt(const coff_section *section, targetAddress < atomAddress + atom->size()) { result = atom; offsetInAtom = targetAddress - atomAddress; - return error_code::success(); + return error_code(); } } // Relocation target is out of range @@ -723,7 +723,7 @@ error_code FileCOFF::getAtomBySymbolIndex(uint32_t index, Atom *&ret) { return ec; ret = _symbolAtom[symbol]; assert(ret); - return error_code::success(); + return error_code(); } /// Add relocation information to an atom based on \p rel. \p rel is an @@ -751,7 +751,7 @@ FileCOFF::addRelocationReference(const coff_relocation *rel, new COFFReference(targetAtom, offsetInAtom, rel->Type, Reference::KindNamespace::COFF, _referenceArch))); - return error_code::success(); + return error_code(); } // Read section contents. @@ -761,10 +761,10 @@ error_code FileCOFF::getSectionContents(StringRef sectionName, if (error_code ec = findSection(sectionName, section)) return ec; if (!section) - return error_code::success(); + return error_code(); if (error_code ec = _obj->getSectionContents(section, result)) return ec; - return error_code::success(); + return error_code(); } /// Returns the target machine type of the current object file. @@ -775,13 +775,13 @@ error_code FileCOFF::getReferenceArch(Reference::KindArch &result) { switch (header->Machine) { case llvm::COFF::IMAGE_FILE_MACHINE_I386: result = Reference::KindArch::x86; - return error_code::success(); + return error_code(); case llvm::COFF::IMAGE_FILE_MACHINE_AMD64: result = Reference::KindArch::x86_64; - return error_code::success(); + return error_code(); case llvm::COFF::IMAGE_FILE_MACHINE_UNKNOWN: result = Reference::KindArch::all; - return error_code::success(); + return error_code(); } llvm::errs() << "Unsupported machine type: " << header->Machine << "\n"; return llvm::object::object_error::parse_failed; @@ -806,7 +806,7 @@ error_code FileCOFF::addRelocationReferenceToAtoms() { return ec; } } - return error_code::success(); + return error_code(); } // Read .sxdata section if exists. .sxdata is a x86-only section that contains a @@ -827,7 +827,7 @@ error_code FileCOFF::maybeCreateSXDataAtoms() { if (error_code ec = getSectionContents(".sxdata", sxdata)) return ec; if (sxdata.empty()) - return error_code::success(); + return error_code(); std::vector<uint8_t> atomContent = *new (_alloc) std::vector<uint8_t>((size_t)sxdata.size()); @@ -851,7 +851,7 @@ error_code FileCOFF::maybeCreateSXDataAtoms() { } _definedAtoms._atoms.push_back(atom); - return error_code::success(); + return error_code(); } /// Find a section by name. @@ -863,12 +863,12 @@ error_code FileCOFF::findSection(StringRef name, const coff_section *&result) { return ec; if (sectionName == name) { result = section; - return error_code::success(); + return error_code(); } } // Section was not found, but it's not an error. This method returns // an error only when there's a read error. - return error_code::success(); + return error_code(); } // Convert ArrayRef<uint8_t> to std::string. The array contains a string which @@ -931,7 +931,7 @@ public: if (error_code ec = file->parse()) return ec; result.push_back(std::move(file)); - return error_code::success(); + return error_code(); } private: @@ -1048,7 +1048,7 @@ public: createAlternateNameAtoms(*file); result.push_back(std::move(file)); - return error_code::success(); + return error_code(); } private: @@ -1086,7 +1086,7 @@ private: if (!errorMessage.empty()) { llvm::errs() << "lld warning: " << errorMessage << "\n"; } - return error_code::success(); + return error_code(); } AliasAtom *createAlias(FileCOFF &file, StringRef name, diff --git a/lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp b/lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp index a3361461cd0..8b03faa10b4 100644 --- a/lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp +++ b/lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp @@ -211,7 +211,7 @@ public: if (type == llvm::COFF::IMPORT_CODE) addDefinedAtom(symbolName, dllName, dataAtom); - ec = error_code::success(); + ec = error_code(); } const atom_collection<DefinedAtom> &defined() const override { @@ -307,7 +307,7 @@ public: if (ec) return ec; result.push_back(std::move(file)); - return error_code::success(); + return error_code(); } }; @@ -331,7 +331,7 @@ error_code parseCOFFImportLibrary(const LinkingContext &targetInfo, if (ec) return ec; result.push_back(std::move(file)); - return error_code::success(); + return error_code(); } } // end namespace pecoff diff --git a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp index dbc50873f75..90ec430b84b 100644 --- a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp +++ b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp @@ -663,7 +663,7 @@ template <> struct MappingTraits<const lld::File *> { virtual error_code parseAllMembers(std::vector<std::unique_ptr<File>> &result) const override { - return error_code::success(); + return error_code(); } StringRef _path; @@ -1308,7 +1308,7 @@ public: const lld::File *fileRef = &file; yout << fileRef; - return error_code::success(); + return error_code(); } private: |