diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-12 21:35:33 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-12 21:35:33 +0000 |
commit | f743031b8b923efe8c534bd56b51bb566f36b9cf (patch) | |
tree | ece5edadff5d28b161492d24c27869d4fafbab14 /lld | |
parent | d31b63e6ae3dfa9d28ef98e093fdbe5f5113161f (diff) | |
download | bcm5719-llvm-f743031b8b923efe8c534bd56b51bb566f36b9cf.tar.gz bcm5719-llvm-f743031b8b923efe8c534bd56b51bb566f36b9cf.zip |
More prefixing of error_code.
llvm-svn: 210831
Diffstat (limited to 'lld')
21 files changed, 84 insertions, 82 deletions
diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h index 34e517adb00..dccd5178c84 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h @@ -31,10 +31,10 @@ protected: virtual void finalizeDefaultAtomValues(); - virtual error_code setELFHeader() { + virtual std::error_code setELFHeader() { DynamicLibraryWriter<ELFT>::setELFHeader(); HexagonELFWriter<ELFT>::setELFHeader(*this->_elfHeader); - return error_code(); + return std::error_code(); } private: diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFFile.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFFile.h index 04de51553ee..5205d65f734 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFFile.h +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFFile.h @@ -118,12 +118,12 @@ public: : ELFFile<ELFT>(name, atomizeStrings) {} HexagonELFFile(std::unique_ptr<MemoryBuffer> mb, bool atomizeStrings, - error_code &ec) + std::error_code &ec) : ELFFile<ELFT>(std::move(mb), atomizeStrings, ec) {} static ErrorOr<std::unique_ptr<HexagonELFFile>> create(std::unique_ptr<MemoryBuffer> mb, bool atomizeStrings) { - error_code ec; + std::error_code ec; std::unique_ptr<HexagonELFFile<ELFT>> file( new HexagonELFFile<ELFT>(mb->getBufferIdentifier(), atomizeStrings)); diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h index d99a74f9d05..6bc6ee09cd8 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h @@ -43,7 +43,7 @@ public: HexagonELFObjectReader(bool atomizeStrings) : ELFObjectReader(atomizeStrings) {} - error_code + std::error_code parseFile(std::unique_ptr<MemoryBuffer> &mb, const class Registry &, std::vector<std::unique_ptr<File>> &result) const override { std::size_t maxAlignment = @@ -51,10 +51,10 @@ public: auto f = createELF<HexagonELFFileCreateELFTraits>( llvm::object::getElfArchType(&*mb), maxAlignment, std::move(mb), _atomizeStrings); - if (error_code ec = f.getError()) + if (std::error_code ec = f.getError()) return ec; result.push_back(std::move(*f)); - return error_code(); + return std::error_code(); } }; @@ -62,7 +62,7 @@ class HexagonELFDSOReader : public ELFDSOReader { public: HexagonELFDSOReader(bool useUndefines) : ELFDSOReader(useUndefines) {} - error_code + std::error_code parseFile(std::unique_ptr<MemoryBuffer> &mb, const class Registry &, std::vector<std::unique_ptr<File>> &result) const override { std::size_t maxAlignment = @@ -70,10 +70,10 @@ public: auto f = createELF<HexagonDynamicFileCreateELFTraits>( llvm::object::getElfArchType(&*mb), maxAlignment, std::move(mb), _useUndefines); - if (error_code ec = f.getError()) + if (std::error_code ec = f.getError()) return ec; result.push_back(std::move(*f)); - return error_code(); + return std::error_code(); } }; diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h index b00091a5e6b..2543aebf272 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h @@ -32,10 +32,10 @@ protected: virtual void finalizeDefaultAtomValues(); - virtual error_code setELFHeader() { + virtual std::error_code setELFHeader() { ExecutableWriter<ELFT>::setELFHeader(); HexagonELFWriter<ELFT>::setELFHeader(*this->_elfHeader); - return error_code(); + return std::error_code(); } private: diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp index 89402eadf29..c7df3939c14 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp @@ -211,7 +211,7 @@ static int relocHexGOTREL_32(uint8_t *location, uint64_t P, uint64_t S, return 0; } -error_code HexagonTargetRelocationHandler::applyRelocation( +std::error_code HexagonTargetRelocationHandler::applyRelocation( ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom, const Reference &ref) const { uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset; @@ -220,7 +220,7 @@ error_code HexagonTargetRelocationHandler::applyRelocation( uint64_t relocVAddress = atom._virtualAddr + ref.offsetInAtom(); if (ref.kindNamespace() != Reference::KindNamespace::ELF) - return error_code(); + return std::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(); + return std::error_code(); } diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h index 599b0a41491..905fc0ffe25 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h @@ -24,9 +24,9 @@ public: HexagonTargetRelocationHandler(HexagonTargetLayout<HexagonELFType> &layout) : _hexagonTargetLayout(layout) {} - error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, - const lld::AtomLayout &, - const Reference &) const override; + std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, + const lld::AtomLayout &, + const Reference &) const override; private: HexagonTargetLayout<HexagonELFType> &_hexagonTargetLayout; diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp index 58f3f731609..7a732ed083d 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp @@ -301,19 +301,19 @@ public: return ga; } - error_code handleGOTREL(const Reference &ref) { + std::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(); + return std::error_code(); } - error_code handlePLT32(const Reference &ref) { + std::error_code handlePLT32(const Reference &ref) { // Turn this into a PC32 to the PLT entry. assert(ref.kindNamespace() == Reference::KindNamespace::ELF); 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(); + return std::error_code(); } }; diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h b/lld/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h index f1e47e7ee31..4a6f852ece5 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h @@ -31,10 +31,10 @@ protected: void finalizeDefaultAtomValues() override; - error_code setELFHeader() override { + std::error_code setELFHeader() override { DynamicLibraryWriter<ELFT>::setELFHeader(); _writeHelper.setELFHeader(*this->_elfHeader); - return error_code(); + return std::error_code(); } LLD_UNIQUE_BUMP_PTR(DynamicTable<ELFT>) createDynamicTable(); diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsELFReader.h b/lld/lib/ReaderWriter/ELF/Mips/MipsELFReader.h index f58332f52a5..91fcc50bc08 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsELFReader.h +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsELFReader.h @@ -29,7 +29,7 @@ class MipsELFObjectReader : public ELFObjectReader { public: MipsELFObjectReader(bool atomizeStrings) : ELFObjectReader(atomizeStrings) {} - error_code + std::error_code parseFile(std::unique_ptr<MemoryBuffer> &mb, const class Registry &, std::vector<std::unique_ptr<File>> &result) const override { std::size_t maxAlignment = @@ -37,10 +37,10 @@ public: auto f = createELF<MipsELFFileCreateTraits>( llvm::object::getElfArchType(&*mb), maxAlignment, std::move(mb), _atomizeStrings); - if (error_code ec = f.getError()) + if (std::error_code ec = f.getError()) return ec; result.push_back(std::move(*f)); - return error_code(); + return std::error_code(); } }; diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h b/lld/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h index 8f28312a1d9..9f6e018eec4 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h @@ -33,10 +33,10 @@ protected: void finalizeDefaultAtomValues() override; - error_code setELFHeader() override { + std::error_code setELFHeader() override { ExecutableWriter<ELFT>::setELFHeader(); _writeHelper.setELFHeader(*this->_elfHeader); - return error_code(); + return std::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 d3665022fbc..b3b63f9564d 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp @@ -119,11 +119,11 @@ static void reloc32hi16(uint8_t *location, uint64_t S, int64_t A) { applyReloc(location, (S + A + 0x8000) & 0xffff0000, 0xffffffff); } -error_code MipsTargetRelocationHandler::applyRelocation( +std::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(); + return std::error_code(); assert(ref.kindArch() == Reference::KindArch::Mips); AtomLayout *gpAtom = _mipsTargetLayout.getGP(); @@ -216,5 +216,5 @@ error_code MipsTargetRelocationHandler::applyRelocation( } } - return error_code(); + return std::error_code(); } diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h index 174d1bc21f6..35ff6823b65 100644 --- a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h +++ b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h @@ -22,9 +22,9 @@ public: MipsTargetRelocationHandler(MipsTargetLayout<Mips32ElELFType> &layout) : _mipsTargetLayout(layout) {} - error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, - const lld::AtomLayout &, - const Reference &) const override; + std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, + const lld::AtomLayout &, + const Reference &) const override; private: MipsTargetLayout<Mips32ElELFType> &_mipsTargetLayout; diff --git a/lld/lib/ReaderWriter/ELF/OutputELFWriter.h b/lld/lib/ReaderWriter/ELF/OutputELFWriter.h index 72218ca63c8..fefdb874d95 100644 --- a/lld/lib/ReaderWriter/ELF/OutputELFWriter.h +++ b/lld/lib/ReaderWriter/ELF/OutputELFWriter.h @@ -52,16 +52,16 @@ protected: void buildChunks(const File &file) override; // Build the output file - virtual error_code buildOutput(const File &file); + virtual std::error_code buildOutput(const File &file); // Setup the ELF header. - virtual error_code setELFHeader(); + virtual std::error_code setELFHeader(); // Write the file to the path specified - error_code writeFile(const File &File, StringRef path) override; + std::error_code writeFile(const File &File, StringRef path) override; // Write to the output file. - virtual error_code writeOutput(const File &file, StringRef path); + virtual std::error_code writeOutput(const File &file, StringRef path); // Get the size of the output file that the linker would emit. virtual uint64_t outputFileSize() const; @@ -348,7 +348,7 @@ LLD_UNIQUE_BUMP_PTR(DynamicSymbolTable<ELFT>) } template <class ELFT> -error_code OutputELFWriter<ELFT>::buildOutput(const File &file) { +std::error_code OutputELFWriter<ELFT>::buildOutput(const File &file) { ScopedTask buildTask(getDefaultDomain(), "ELF Writer buildOutput"); buildChunks(file); @@ -394,10 +394,10 @@ error_code OutputELFWriter<ELFT>::buildOutput(const File &file) { if (_context.isDynamic()) _dynamicTable->updateDynamicTable(); - return error_code(); + return std::error_code(); } -template <class ELFT> error_code OutputELFWriter<ELFT>::setELFHeader() { +template <class ELFT> std::error_code OutputELFWriter<ELFT>::setELFHeader() { _elfHeader->e_ident(ELF::EI_CLASS, _context.is64Bits() ? ELF::ELFCLASS64 : ELF::ELFCLASS32); _elfHeader->e_ident(ELF::EI_DATA, _context.isLittleEndian() @@ -419,7 +419,7 @@ template <class ELFT> error_code OutputELFWriter<ELFT>::setELFHeader() { _layout.findAtomAddrByName(_context.entrySymbolName(), virtualAddr); _elfHeader->e_entry(virtualAddr); - return error_code(); + return std::error_code(); } template <class ELFT> uint64_t OutputELFWriter<ELFT>::outputFileSize() const { @@ -427,12 +427,12 @@ template <class ELFT> uint64_t OutputELFWriter<ELFT>::outputFileSize() const { } template <class ELFT> -error_code OutputELFWriter<ELFT>::writeOutput(const File &file, - StringRef path) { +std::error_code OutputELFWriter<ELFT>::writeOutput(const File &file, + StringRef path) { std::unique_ptr<FileOutputBuffer> buffer; ScopedTask createOutputTask(getDefaultDomain(), "ELF Writer Create Output"); - error_code ec = FileOutputBuffer::create(path, outputFileSize(), buffer, - FileOutputBuffer::F_executable); + std::error_code ec = FileOutputBuffer::create(path, outputFileSize(), buffer, + FileOutputBuffer::F_executable); createOutputTask.end(); if (ec) @@ -455,8 +455,9 @@ error_code OutputELFWriter<ELFT>::writeOutput(const File &file, } template <class ELFT> -error_code OutputELFWriter<ELFT>::writeFile(const File &file, StringRef path) { - error_code ec = buildOutput(file); +std::error_code OutputELFWriter<ELFT>::writeFile(const File &file, + StringRef path) { + std::error_code ec = buildOutput(file); if (ec) return ec; diff --git a/lld/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp b/lld/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp index f76b169da84..5f01b2d6f9c 100644 --- a/lld/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp @@ -35,7 +35,7 @@ static int relocB24PCREL(uint8_t *location, uint64_t P, uint64_t S, return 1; } -error_code PPCTargetRelocationHandler::applyRelocation( +std::error_code PPCTargetRelocationHandler::applyRelocation( ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom, const Reference &ref) const { uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset; @@ -44,7 +44,7 @@ error_code PPCTargetRelocationHandler::applyRelocation( uint64_t relocVAddress = atom._virtualAddr + ref.offsetInAtom(); if (ref.kindNamespace() != Reference::KindNamespace::ELF) - return error_code(); + return std::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(); + return std::error_code(); } PPCTargetHandler::PPCTargetHandler(PPCLinkingContext &context) diff --git a/lld/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.h b/lld/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.h index f27aed01d65..4c8b8c58124 100644 --- a/lld/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.h +++ b/lld/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.h @@ -30,9 +30,9 @@ public: PPCTargetLayout<PPCELFType> &layout) : _ppcContext(context), _ppcTargetLayout(layout) {} - virtual error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, - const lld::AtomLayout &, - const Reference &) const override; + virtual std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, + const lld::AtomLayout &, + const Reference &) const override; protected: PPCLinkingContext &_ppcContext; diff --git a/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp b/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp index 25ad7a805d6..3fe61a7ed6e 100644 --- a/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp @@ -96,7 +96,7 @@ void X86TargetHandler::registerRelocationNames(Registry ®istry) { kindStrings); } -error_code X86TargetRelocationHandler::applyRelocation( +std::error_code X86TargetRelocationHandler::applyRelocation( ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom, const Reference &ref) const { uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset; @@ -105,7 +105,7 @@ error_code X86TargetRelocationHandler::applyRelocation( uint64_t relocVAddress = atom._virtualAddr + ref.offsetInAtom(); if (ref.kindNamespace() != Reference::KindNamespace::ELF) - return error_code(); + return std::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(); + return std::error_code(); } X86TargetHandler::X86TargetHandler(X86LinkingContext &context) diff --git a/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.h b/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.h index 1bd10c2f92a..d1c2d6952b6 100644 --- a/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.h +++ b/lld/lib/ReaderWriter/ELF/X86/X86TargetHandler.h @@ -33,9 +33,9 @@ public: X86TargetLayout<X86ELFType> &layout) : _x86Context(context), _x86TargetLayout(layout) {} - error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, - const lld::AtomLayout &, - const Reference &) const override; + std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, + const lld::AtomLayout &, + const Reference &) const override; static const Registry::KindStrings kindStrings[]; diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp index 1b800a58264..65087b71b8c 100644 --- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp +++ b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp @@ -60,7 +60,7 @@ int64_t X86_64TargetRelocationHandler::relocAddend(const Reference &ref) const { return 0; } -error_code X86_64TargetRelocationHandler::applyRelocation( +std::error_code X86_64TargetRelocationHandler::applyRelocation( ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom, const Reference &ref) const { uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset; @@ -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(); + return std::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(); + return std::error_code(); } diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h index 366441dc552..6158bad2f31 100644 --- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h +++ b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h @@ -24,9 +24,9 @@ public: X86_64TargetRelocationHandler(X86_64TargetLayout<X86_64ELFType> &layout) : _tlsSize(0), _x86_64Layout(layout) {} - error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, - const lld::AtomLayout &, - const Reference &) const override; + std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &, + const lld::AtomLayout &, + const Reference &) const override; virtual int64_t relocAddend(const Reference &) const; diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp index fd8baf6036a..04c6ba85247 100644 --- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp +++ b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp @@ -149,11 +149,11 @@ protected: /// /// This create a PLT and GOT entry for the IFUNC if one does not exist. The /// GOT entry and a IRELATIVE relocation to the original target resolver. - error_code handleIFUNC(const Reference &ref) { + std::error_code handleIFUNC(const Reference &ref) { 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(); + return std::error_code(); } /// \brief Create a GOT entry for the TP offset of a TLS atom. @@ -300,13 +300,13 @@ public: StaticRelocationPass(const elf::X86_64LinkingContext &ctx) : RelocationPass(ctx) {} - error_code handlePlain(const Reference &ref) { return handleIFUNC(ref); } + std::error_code handlePlain(const Reference &ref) { return handleIFUNC(ref); } - error_code handlePLT32(const Reference &ref) { + std::error_code handlePLT32(const Reference &ref) { // __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(); + return std::error_code(); } // Static code doesn't need PLTs. const_cast<Reference &>(ref).setKindValue(R_X86_64_PC32); @@ -315,15 +315,15 @@ public: dyn_cast_or_null<const DefinedAtom>(ref.target())) if (da->contentType() == DefinedAtom::typeResolver) return handleIFUNC(ref); - return error_code(); + return std::error_code(); } - error_code handleGOT(const Reference &ref) { + std::error_code handleGOT(const Reference &ref) { if (isa<UndefinedAtom>(ref.target())) 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(); + return std::error_code(); } }; @@ -393,9 +393,9 @@ public: return oa; } - error_code handlePlain(const Reference &ref) { + std::error_code handlePlain(const Reference &ref) { if (!ref.target()) - return error_code(); + return std::error_code(); if (auto sla = dyn_cast<SharedLibraryAtom>(ref.target())) { if (sla->type() == SharedLibraryAtom::Type::Data) const_cast<Reference &>(ref).setTarget(getObjectEntry(sla)); @@ -403,10 +403,10 @@ public: const_cast<Reference &>(ref).setTarget(getPLTEntry(sla)); } else return handleIFUNC(ref); - return error_code(); + return std::error_code(); } - error_code handlePLT32(const Reference &ref) { + std::error_code handlePLT32(const Reference &ref) { // Turn this into a PC32 to the PLT entry. const_cast<Reference &>(ref).setKindValue(R_X86_64_PC32); // Handle IFUNC. @@ -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(); + return std::error_code(); } const GOTAtom *getSharedGOT(const SharedLibraryAtom *sla) { @@ -435,14 +435,14 @@ public: return got->second; } - error_code handleGOT(const Reference &ref) { + std::error_code handleGOT(const Reference &ref) { if (isa<UndefinedAtom>(ref.target())) const_cast<Reference &>(ref).setTarget(getNullGOT()); else if (const DefinedAtom *da = dyn_cast<const DefinedAtom>(ref.target())) 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(); + return std::error_code(); } }; } // end anon namespace diff --git a/lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp b/lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp index 1d5438f5ad4..76db43a22cd 100644 --- a/lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp +++ b/lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp @@ -141,6 +141,7 @@ using namespace lld; using namespace lld::pecoff; using namespace llvm; +using std::error_code; #define DEBUG_TYPE "ReaderImportHeader" |