[lld] r210831 - More prefixing of error_code.

Rafael Espindola rafael.espindola at gmail.com
Thu Jun 12 14:35:33 PDT 2014


Author: rafael
Date: Thu Jun 12 16:35:33 2014
New Revision: 210831

URL: http://llvm.org/viewvc/llvm-project?rev=210831&view=rev
Log:
More prefixing of error_code.

Modified:
    lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h
    lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFFile.h
    lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h
    lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h
    lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp
    lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h
    lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
    lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h
    lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFReader.h
    lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h
    lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
    lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h
    lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h
    lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp
    lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.h
    lld/trunk/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp
    lld/trunk/lib/ReaderWriter/ELF/X86/X86TargetHandler.h
    lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp
    lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h
    lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp
    lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp

Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h Thu Jun 12 16:35:33 2014
@@ -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:

Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFFile.h?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFFile.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFFile.h Thu Jun 12 16:35:33 2014
@@ -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));
 

Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFReader.h Thu Jun 12 16:35:33 2014
@@ -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 ELFDS
 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();
   }
 };
 

Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h Thu Jun 12 16:35:33 2014
@@ -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:

Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp Thu Jun 12 16:35:33 2014
@@ -211,7 +211,7 @@ static int relocHexGOTREL_32(uint8_t *lo
   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 HexagonTargetRelocationHandle
   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 HexagonTargetRelocationHandle
   }
   }
 
-  return error_code();
+  return std::error_code();
 }
 
 

Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h Thu Jun 12 16:35:33 2014
@@ -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;

Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp Thu Jun 12 16:35:33 2014
@@ -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();
   }
 };
 

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsDynamicLibraryWriter.h Thu Jun 12 16:35:33 2014
@@ -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();

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFReader.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFReader.h?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFReader.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFReader.h Thu Jun 12 16:35:33 2014
@@ -29,7 +29,7 @@ class MipsELFObjectReader : public ELFOb
 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();
   }
 };
 

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h Thu Jun 12 16:35:33 2014
@@ -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();

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp Thu Jun 12 16:35:33 2014
@@ -119,11 +119,11 @@ static void reloc32hi16(uint8_t *locatio
   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::
   }
   }
 
-  return error_code();
+  return std::error_code();
 }

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h Thu Jun 12 16:35:33 2014
@@ -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;

Modified: lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h Thu Jun 12 16:35:33 2014
@@ -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<E
 }
 
 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>::buildO
   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 OutputE
   _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 OutputELF
 }
 
 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>::writeO
 }
 
 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;
 

Modified: lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp Thu Jun 12 16:35:33 2014
@@ -35,7 +35,7 @@ static int relocB24PCREL(uint8_t *locati
   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::a
   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::a
   }
   }
 
-  return error_code();
+  return std::error_code();
 }
 
 PPCTargetHandler::PPCTargetHandler(PPCLinkingContext &context)

Modified: lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.h?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/PPC/PPCTargetHandler.h Thu Jun 12 16:35:33 2014
@@ -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;

Modified: lld/trunk/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp Thu Jun 12 16:35:33 2014
@@ -96,7 +96,7 @@ void X86TargetHandler::registerRelocatio
                         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::a
   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::a
   }
   }
 
-  return error_code();
+  return std::error_code();
 }
 
 X86TargetHandler::X86TargetHandler(X86LinkingContext &context)

Modified: lld/trunk/lib/ReaderWriter/ELF/X86/X86TargetHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86/X86TargetHandler.h?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86/X86TargetHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86/X86TargetHandler.h Thu Jun 12 16:35:33 2014
@@ -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[];
 

Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp Thu Jun 12 16:35:33 2014
@@ -60,7 +60,7 @@ int64_t X86_64TargetRelocationHandler::r
   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
   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
   }
   }
 
-  return error_code();
+  return std::error_code();
 }

Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h Thu Jun 12 16:35:33 2014
@@ -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;
 

Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp Thu Jun 12 16:35:33 2014
@@ -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

Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp?rev=210831&r1=210830&r2=210831&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp Thu Jun 12 16:35:33 2014
@@ -141,6 +141,7 @@
 using namespace lld;
 using namespace lld::pecoff;
 using namespace llvm;
+using std::error_code;
 
 #define DEBUG_TYPE "ReaderImportHeader"
 





More information about the llvm-commits mailing list