Don't use 'using std::error_code' in include/llvm.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 12 Jun 2014 21:46:39 +0000 (21:46 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 12 Jun 2014 21:46:39 +0000 (21:46 +0000)
This should make sure that most new uses use the std prefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210835 91177308-0d34-0410-b5e6-96231b3b80d8

107 files changed:
include/llvm/ExecutionEngine/SectionMemoryManager.h
include/llvm/IR/GVMaterializer.h
include/llvm/IR/Module.h
include/llvm/Object/Archive.h
include/llvm/Object/COFF.h
include/llvm/Object/ELF.h
include/llvm/Object/ELFObjectFile.h
include/llvm/Object/Error.h
include/llvm/Object/IRObjectFile.h
include/llvm/Object/MachO.h
include/llvm/Object/MachOUniversal.h
include/llvm/Object/ObjectFile.h
include/llvm/Object/SymbolicFile.h
include/llvm/ProfileData/InstrProf.h
include/llvm/ProfileData/InstrProfReader.h
include/llvm/ProfileData/InstrProfWriter.h
include/llvm/Support/ErrorOr.h
include/llvm/Support/FileOutputBuffer.h
include/llvm/Support/FileSystem.h
include/llvm/Support/LockFileManager.h
include/llvm/Support/Memory.h
include/llvm/Support/MemoryBuffer.h
include/llvm/Support/Process.h
include/llvm/Support/Program.h
lib/AsmParser/Parser.cpp
lib/Bitcode/Reader/BitReader.cpp
lib/Bitcode/Reader/BitcodeReader.h
lib/DebugInfo/DWARFContext.cpp
lib/ExecutionEngine/Interpreter/Interpreter.cpp
lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
lib/IR/Core.cpp
lib/IR/GCOV.cpp
lib/IR/Module.cpp
lib/IRReader/IRReader.cpp
lib/LTO/LTOCodeGenerator.cpp
lib/LTO/LTOModule.cpp
lib/MC/MCContext.cpp
lib/MC/MCModuleYAML.cpp
lib/Object/Archive.cpp
lib/Object/Binary.cpp
lib/Object/COFFObjectFile.cpp
lib/Object/ELFObjectFile.cpp
lib/Object/IRObjectFile.cpp
lib/Object/MachOObjectFile.cpp
lib/Object/MachOUniversal.cpp
lib/Object/Object.cpp
lib/Object/ObjectFile.cpp
lib/ProfileData/InstrProfReader.cpp
lib/ProfileData/InstrProfWriter.cpp
lib/Support/DataStream.cpp
lib/Support/FileOutputBuffer.cpp
lib/Support/FileUtilities.cpp
lib/Support/GraphWriter.cpp
lib/Support/LockFileManager.cpp
lib/Support/MemoryBuffer.cpp
lib/Support/Path.cpp
lib/Support/Unix/Memory.inc
lib/Support/Unix/Process.inc
lib/Support/Unix/Program.inc
lib/Support/Windows/Memory.inc
lib/Support/Windows/Process.inc
lib/Support/Windows/Program.inc
lib/Support/YAMLTraits.cpp
lib/Support/raw_ostream.cpp
lib/TableGen/Main.cpp
lib/Transforms/Scalar/SampleProfile.cpp
lib/Transforms/Scalar/SimplifyCFGPass.cpp
lib/Transforms/Utils/SpecialCaseList.cpp
tools/bugpoint/ExecutionDriver.cpp
tools/bugpoint/ExtractFunction.cpp
tools/bugpoint/Miscompilation.cpp
tools/bugpoint/OptimizerDriver.cpp
tools/bugpoint/ToolRunner.cpp
tools/gold/gold-plugin.cpp
tools/lli/RemoteMemoryManager.cpp
tools/lli/lli.cpp
tools/llvm-ar/llvm-ar.cpp
tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
tools/llvm-cov/llvm-cov.cpp
tools/llvm-dis/llvm-dis.cpp
tools/llvm-dwarfdump/llvm-dwarfdump.cpp
tools/llvm-mc/llvm-mc.cpp
tools/llvm-mcmarkup/llvm-mcmarkup.cpp
tools/llvm-nm/llvm-nm.cpp
tools/llvm-objdump/llvm-objdump.cpp
tools/llvm-objdump/llvm-objdump.h
tools/llvm-profdata/llvm-profdata.cpp
tools/llvm-readobj/ARMEHABIPrinter.h
tools/llvm-readobj/ARMWinEHPrinter.h
tools/llvm-readobj/Win64EHDumper.cpp
tools/llvm-readobj/Win64EHDumper.h
tools/llvm-readobj/llvm-readobj.h
tools/llvm-rtdyld/llvm-rtdyld.cpp
tools/llvm-size/llvm-size.cpp
tools/llvm-symbolizer/LLVMSymbolize.cpp
tools/llvm-symbolizer/llvm-symbolizer.cpp
tools/macho-dump/macho-dump.cpp
tools/obj2yaml/coff2yaml.cpp
unittests/ExecutionEngine/JIT/JITTest.cpp
unittests/Support/FileOutputBufferTest.cpp
unittests/Support/LockFileManagerTest.cpp
unittests/Support/MemoryBufferTest.cpp
unittests/Support/MemoryTest.cpp
unittests/Support/Path.cpp
utils/FileCheck/FileCheck.cpp
utils/FileUpdate/FileUpdate.cpp

index f24bb4d5a52a86f87bf86cf02be7a5c43be18132..136856390b21d7a31e0fa5112755188653a0f206 100644 (file)
@@ -21,7 +21,6 @@
 #include "llvm/Support/Memory.h"
 
 namespace llvm {
-
 /// This is a simple memory manager which implements the methods called by
 /// the RuntimeDyld class to allocate memory for section-based loading of
 /// objects, usually those generated by the MCJIT execution engine.
@@ -93,8 +92,8 @@ private:
   uint8_t *allocateSection(MemoryGroup &MemGroup, uintptr_t Size,
                            unsigned Alignment);
 
-  error_code applyMemoryGroupPermissions(MemoryGroup &MemGroup,
-                                         unsigned Permissions);
+  std::error_code applyMemoryGroupPermissions(MemoryGroup &MemGroup,
+                                              unsigned Permissions);
 
   MemoryGroup CodeMem;
   MemoryGroup RWDataMem;
index 229048a3ba2e4fb9bc9dd9ce2dcfa6cd1dfab5f6..4afdbb05f8541fa2e08d56e7140224713c1c19cd 100644 (file)
@@ -21,7 +21,6 @@
 #include <system_error>
 
 namespace llvm {
-using std::error_code;
 class Function;
 class GlobalValue;
 class Module;
@@ -43,7 +42,7 @@ public:
 
   /// Make sure the given GlobalValue is fully read.
   ///
-  virtual error_code Materialize(GlobalValue *GV) = 0;
+  virtual std::error_code Materialize(GlobalValue *GV) = 0;
 
   /// If the given GlobalValue is read in, and if the GVMaterializer supports
   /// it, release the memory for the GV, and set it up to be materialized
@@ -54,7 +53,7 @@ public:
 
   /// Make sure the entire Module has been completely read.
   ///
-  virtual error_code MaterializeModule(Module *M) = 0;
+  virtual std::error_code MaterializeModule(Module *M) = 0;
 };
 
 } // End llvm namespace
index 7e991588733a2f4ca0368f1cc43ee49c0283efcf..e2b86f62fb8df479682b90d527f4983407ee2245 100644 (file)
@@ -26,7 +26,6 @@
 #include <system_error>
 
 namespace llvm {
-
 class FunctionType;
 class GVMaterializer;
 class LLVMContext;
@@ -454,12 +453,12 @@ public:
   void Dematerialize(GlobalValue *GV);
 
   /// Make sure all GlobalValues in this Module are fully read.
-  error_code materializeAll();
+  std::error_code materializeAll();
 
   /// Make sure all GlobalValues in this Module are fully read and clear the
   /// Materializer. If the module is corrupt, this DOES NOT clear the old
   /// Materializer.
-  error_code materializeAllPermanently();
+  std::error_code materializeAllPermanently();
 
 /// @}
 /// @name Direct access to the globals list, functions list, and symbol table
index 652b6597bebfb2e748de8c2362901089d26d47d1..600ab23a78d6e06c83dbf3d4cff299400aa9bcfe 100644 (file)
@@ -72,7 +72,7 @@ public:
 
     Child getNext() const;
 
-    error_code getName(StringRef &Result) const;
+    std::error_code getName(StringRef &Result) const;
     StringRef getRawName() const { return getHeader()->getName(); }
     sys::TimeValue getLastModified() const {
       return getHeader()->getLastModified();
@@ -89,11 +89,11 @@ public:
       return StringRef(Data.data() + StartOfFile, getSize());
     }
 
-    error_code getMemoryBuffer(std::unique_ptr<MemoryBuffer> &Result,
-                               bool FullPath = false) const;
+    std::error_code getMemoryBuffer(std::unique_ptr<MemoryBuffer> &Result,
+                                    bool FullPath = false) const;
 
-    error_code getAsBinary(std::unique_ptr<Binary> &Result,
-                           LLVMContext *Context = nullptr) const;
+    std::error_code getAsBinary(std::unique_ptr<Binary> &Result,
+                                LLVMContext *Context = nullptr) const;
   };
 
   class child_iterator {
@@ -137,8 +137,8 @@ public:
       : Parent(p)
       , SymbolIndex(symi)
       , StringIndex(stri) {}
-    error_code getName(StringRef &Result) const;
-    error_code getMember(child_iterator &Result) const;
+    std::error_code getName(StringRef &Result) const;
+    std::error_code getMember(child_iterator &Result) const;
     Symbol getNext() const;
   };
 
@@ -164,7 +164,7 @@ public:
     }
   };
 
-  Archive(MemoryBuffer *source, error_code &ec);
+  Archive(MemoryBuffer *source, std::error_code &ec);
   static ErrorOr<Archive *> create(MemoryBuffer *Source);
 
   enum Kind {
index bd9c67740dff8a72c9a30207bf48d01d0358cde7..f0f2793a928c086581d0f59dcb065c5f7c5d22d0 100644 (file)
@@ -353,65 +353,75 @@ private:
   uint32_t NumberOfImportDirectory;
   const export_directory_table_entry *ExportDirectory;
 
-  error_code getString(uint32_t offset, StringRef &Res) const;
+  std::error_code getString(uint32_t offset, StringRef &Res) const;
 
   const coff_symbol *toSymb(DataRefImpl Symb) const;
   const coff_section *toSec(DataRefImpl Sec) const;
   const coff_relocation *toRel(DataRefImpl Rel) const;
 
-  error_code initSymbolTablePtr();
-  error_code initImportTablePtr();
-  error_code initExportTablePtr();
+  std::error_code initSymbolTablePtr();
+  std::error_code initImportTablePtr();
+  std::error_code initExportTablePtr();
 
 protected:
   void moveSymbolNext(DataRefImpl &Symb) const override;
-  error_code getSymbolName(DataRefImpl Symb, StringRef &Res) const override;
-  error_code getSymbolAddress(DataRefImpl Symb, uint64_t &Res) const override;
-  error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const override;
+  std::error_code getSymbolName(DataRefImpl Symb,
+                                StringRef &Res) const override;
+  std::error_code getSymbolAddress(DataRefImpl Symb,
+                                   uint64_t &Res) const override;
+  std::error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const override;
   uint32_t getSymbolFlags(DataRefImpl Symb) const override;
-  error_code getSymbolType(DataRefImpl Symb,
-                           SymbolRef::Type &Res) const override;
-  error_code getSymbolSection(DataRefImpl Symb,
-                              section_iterator &Res) const override;
+  std::error_code getSymbolType(DataRefImpl Symb,
+                                SymbolRef::Type &Res) const override;
+  std::error_code getSymbolSection(DataRefImpl Symb,
+                                   section_iterator &Res) const override;
   void moveSectionNext(DataRefImpl &Sec) const override;
-  error_code getSectionName(DataRefImpl Sec, StringRef &Res) const override;
-  error_code getSectionAddress(DataRefImpl Sec, uint64_t &Res) const override;
-  error_code getSectionSize(DataRefImpl Sec, uint64_t &Res) const override;
-  error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const override;
-  error_code getSectionAlignment(DataRefImpl Sec, uint64_t &Res) const override;
-  error_code isSectionText(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionData(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionBSS(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionVirtual(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionZeroInit(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionReadOnlyData(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionRequiredForExecution(DataRefImpl Sec,
-                                           bool &Res) const override;
-  error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
-                                   bool &Result) const override;
+  std::error_code getSectionName(DataRefImpl Sec,
+                                 StringRef &Res) const override;
+  std::error_code getSectionAddress(DataRefImpl Sec,
+                                    uint64_t &Res) const override;
+  std::error_code getSectionSize(DataRefImpl Sec, uint64_t &Res) const override;
+  std::error_code getSectionContents(DataRefImpl Sec,
+                                     StringRef &Res) const override;
+  std::error_code getSectionAlignment(DataRefImpl Sec,
+                                      uint64_t &Res) const override;
+  std::error_code isSectionText(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionData(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionBSS(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionVirtual(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionZeroInit(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionReadOnlyData(DataRefImpl Sec,
+                                        bool &Res) const override;
+  std::error_code isSectionRequiredForExecution(DataRefImpl Sec,
+                                                bool &Res) const override;
+  std::error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
+                                        bool &Result) const override;
   relocation_iterator section_rel_begin(DataRefImpl Sec) const override;
   relocation_iterator section_rel_end(DataRefImpl Sec) const override;
 
   void moveRelocationNext(DataRefImpl &Rel) const override;
-  error_code getRelocationAddress(DataRefImpl Rel,
-                                  uint64_t &Res) const override;
-  error_code getRelocationOffset(DataRefImpl Rel, uint64_t &Res) const override;
+  std::error_code getRelocationAddress(DataRefImpl Rel,
+                                       uint64_t &Res) const override;
+  std::error_code getRelocationOffset(DataRefImpl Rel,
+                                      uint64_t &Res) const override;
   symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override;
-  error_code getRelocationType(DataRefImpl Rel, uint64_t &Res) const override;
-  error_code
+  std::error_code getRelocationType(DataRefImpl Rel,
+                                    uint64_t &Res) const override;
+  std::error_code
   getRelocationTypeName(DataRefImpl Rel,
                         SmallVectorImpl<char> &Result) const override;
-  error_code
+  std::error_code
   getRelocationValueString(DataRefImpl Rel,
                            SmallVectorImpl<char> &Result) const override;
 
-  error_code getLibraryNext(DataRefImpl LibData,
-                            LibraryRef &Result) const override;
-  error_code getLibraryPath(DataRefImpl LibData,
-                            StringRef &Result) const override;
+  std::error_code getLibraryNext(DataRefImpl LibData,
+                                 LibraryRef &Result) const override;
+  std::error_code getLibraryPath(DataRefImpl LibData,
+                                 StringRef &Result) const override;
 
 public:
-  COFFObjectFile(MemoryBuffer *Object, error_code &EC, bool BufferOwned = true);
+  COFFObjectFile(MemoryBuffer *Object, std::error_code &EC,
+                 bool BufferOwned = true);
   basic_symbol_iterator symbol_begin_impl() const override;
   basic_symbol_iterator symbol_end_impl() const override;
   library_iterator needed_library_begin() const override;
@@ -433,30 +443,33 @@ public:
   export_directory_iterator export_directory_begin() const;
   export_directory_iterator export_directory_end() const;
 
-  error_code getHeader(const coff_file_header *&Res) const;
-  error_code getCOFFHeader(const coff_file_header *&Res) const;
-  error_code getPE32Header(const pe32_header *&Res) const;
-  error_code getPE32PlusHeader(const pe32plus_header *&Res) const;
-  error_code getDataDirectory(uint32_t index, const data_directory *&Res) const;
-  error_code getSection(int32_t index, const coff_section *&Res) const;
-  error_code getSymbol(uint32_t index, const coff_symbol *&Res) const;
+  std::error_code getHeader(const coff_file_header *&Res) const;
+  std::error_code getCOFFHeader(const coff_file_header *&Res) const;
+  std::error_code getPE32Header(const pe32_header *&Res) const;
+  std::error_code getPE32PlusHeader(const pe32plus_header *&Res) const;
+  std::error_code getDataDirectory(uint32_t index,
+                                   const data_directory *&Res) const;
+  std::error_code getSection(int32_t index, const coff_section *&Res) const;
+  std::error_code getSymbol(uint32_t index, const coff_symbol *&Res) const;
   template <typename T>
-  error_code getAuxSymbol(uint32_t index, const T *&Res) const {
+  std::error_code getAuxSymbol(uint32_t index, const T *&Res) const {
     const coff_symbol *s;
-    error_code ec = getSymbol(index, s);
+    std::error_code ec = getSymbol(index, s);
     Res = reinterpret_cast<const T *>(s);
     return ec;
   }
-  error_code getSymbolName(const coff_symbol *symbol, StringRef &Res) const;
+  std::error_code getSymbolName(const coff_symbol *symbol,
+                                StringRef &Res) const;
   ArrayRef<uint8_t> getSymbolAuxData(const coff_symbol *symbol) const;
 
-  error_code getSectionName(const coff_section *Sec, StringRef &Res) const;
-  error_code getSectionContents(const coff_section *Sec,
-                                ArrayRef<uint8_t> &Res) const;
+  std::error_code getSectionName(const coff_section *Sec, StringRef &Res) const;
+  std::error_code getSectionContents(const coff_section *Sec,
+                                     ArrayRef<uint8_t> &Res) const;
 
-  error_code getVaPtr(uint64_t VA, uintptr_t &Res) const;
-  error_code getRvaPtr(uint32_t Rva, uintptr_t &Res) const;
-  error_code getHintName(uint32_t Rva, uint16_t &Hint, StringRef &Name) const;
+  std::error_code getVaPtr(uint64_t VA, uintptr_t &Res) const;
+  std::error_code getRvaPtr(uint32_t Rva, uintptr_t &Res) const;
+  std::error_code getHintName(uint32_t Rva, uint16_t &Hint,
+                              StringRef &Name) const;
 
   static inline bool classof(const Binary *v) { return v->isCOFF(); }
 };
@@ -471,12 +484,12 @@ public:
 
   bool operator==(const ImportDirectoryEntryRef &Other) const;
   void moveNext();
-  error_code getName(StringRef &Result) const;
+  std::error_code getName(StringRef &Result) const;
 
-  error_code
+  std::error_code
   getImportTableEntry(const import_directory_table_entry *&Result) const;
 
-  error_code
+  std::error_code
   getImportLookupEntry(const import_lookup_table_entry32 *&Result) const;
 
 private:
@@ -496,11 +509,11 @@ public:
   bool operator==(const ExportDirectoryEntryRef &Other) const;
   void moveNext();
 
-  error_code getDllName(StringRef &Result) const;
-  error_code getOrdinalBase(uint32_t &Result) const;
-  error_code getOrdinal(uint32_t &Result) const;
-  error_code getExportRVA(uint32_t &Result) const;
-  error_code getSymbolName(StringRef &Result) const;
+  std::error_code getDllName(StringRef &Result) const;
+  std::error_code getOrdinalBase(uint32_t &Result) const;
+  std::error_code getOrdinal(uint32_t &Result) const;
+  std::error_code getExportRVA(uint32_t &Result) const;
+  std::error_code getSymbolName(StringRef &Result) const;
 
 private:
   const export_directory_table_entry *ExportTable;
index 608d937735b6a0b55e496aa3b85181adb90e87c8..716b3b93c0eab954b00e208579147e3921a251e2 100644 (file)
@@ -317,7 +317,7 @@ public:
   std::pair<const Elf_Shdr *, const Elf_Sym *>
   getRelocationSymbol(const Elf_Shdr *RelSec, const RelT *Rel) const;
 
-  ELFFile(MemoryBuffer *Object, error_code &ec);
+  ELFFile(MemoryBuffer *Object, std::error_code &ec);
 
   bool isMipsELF64() const {
     return Header->e_machine == ELF::EM_MIPS &&
@@ -621,16 +621,11 @@ typename ELFFile<ELFT>::uintX_t ELFFile<ELFT>::getStringTableIndex() const {
 }
 
 template <class ELFT>
-ELFFile<ELFT>::ELFFile(MemoryBuffer *Object, error_code &ec)
-    : Buf(Object),
-      SectionHeaderTable(nullptr),
-      dot_shstrtab_sec(nullptr),
-      dot_strtab_sec(nullptr),
-      dot_symtab_sec(nullptr),
-      SymbolTableSectionHeaderIndex(nullptr),
-      dot_gnu_version_sec(nullptr),
-      dot_gnu_version_r_sec(nullptr),
-      dot_gnu_version_d_sec(nullptr),
+ELFFile<ELFT>::ELFFile(MemoryBuffer *Object, std::error_code &ec)
+    : Buf(Object), SectionHeaderTable(nullptr), dot_shstrtab_sec(nullptr),
+      dot_strtab_sec(nullptr), dot_symtab_sec(nullptr),
+      SymbolTableSectionHeaderIndex(nullptr), dot_gnu_version_sec(nullptr),
+      dot_gnu_version_r_sec(nullptr), dot_gnu_version_d_sec(nullptr),
       dt_soname(nullptr) {
   const uint64_t FileSize = Buf->getBufferSize();
 
@@ -748,7 +743,7 @@ ELFFile<ELFT>::ELFFile(MemoryBuffer *Object, error_code &ec)
     }
   }
 
-  ec = error_code();
+  ec = std::error_code();
 }
 
 // Get the symbol table index in the symtab section given a symbol
index 302cabaf8eade08fba6655c395368b2eea71b58e..876206b38a1e2c1efa40d7b2222279d2eeb26171 100644 (file)
@@ -57,50 +57,63 @@ protected:
   ELFFile<ELFT> EF;
 
   void moveSymbolNext(DataRefImpl &Symb) const override;
-  error_code getSymbolName(DataRefImpl Symb, StringRef &Res) const override;
-  error_code getSymbolAddress(DataRefImpl Symb, uint64_t &Res) const override;
-  error_code getSymbolAlignment(DataRefImpl Symb, uint32_t &Res) const override;
-  error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const override;
+  std::error_code getSymbolName(DataRefImpl Symb,
+                                StringRef &Res) const override;
+  std::error_code getSymbolAddress(DataRefImpl Symb,
+                                   uint64_t &Res) const override;
+  std::error_code getSymbolAlignment(DataRefImpl Symb,
+                                     uint32_t &Res) const override;
+  std::error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const override;
   uint32_t getSymbolFlags(DataRefImpl Symb) const override;
-  error_code getSymbolType(DataRefImpl Symb,
-                           SymbolRef::Type &Res) const override;
-  error_code getSymbolSection(DataRefImpl Symb,
-                              section_iterator &Res) const override;
+  std::error_code getSymbolType(DataRefImpl Symb,
+                                SymbolRef::Type &Res) const override;
+  std::error_code getSymbolSection(DataRefImpl Symb,
+                                   section_iterator &Res) const override;
 
-  error_code getLibraryNext(DataRefImpl Data,
-                            LibraryRef &Result) const override;
-  error_code getLibraryPath(DataRefImpl Data, StringRef &Res) const override;
+  std::error_code getLibraryNext(DataRefImpl Data,
+                                 LibraryRef &Result) const override;
+  std::error_code getLibraryPath(DataRefImpl Data,
+                                 StringRef &Res) const override;
 
   void moveSectionNext(DataRefImpl &Sec) const override;
-  error_code getSectionName(DataRefImpl Sec, StringRef &Res) const override;
-  error_code getSectionAddress(DataRefImpl Sec, uint64_t &Res) const override;
-  error_code getSectionSize(DataRefImpl Sec, uint64_t &Res) const override;
-  error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const override;
-  error_code getSectionAlignment(DataRefImpl Sec, uint64_t &Res) const override;
-  error_code isSectionText(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionData(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionBSS(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionRequiredForExecution(DataRefImpl Sec,
-                                           bool &Res) const override;
-  error_code isSectionVirtual(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionZeroInit(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionReadOnlyData(DataRefImpl Sec, bool &Res) const override;
-  error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
-                                   bool &Result) const override;
+  std::error_code getSectionName(DataRefImpl Sec,
+                                 StringRef &Res) const override;
+  std::error_code getSectionAddress(DataRefImpl Sec,
+                                    uint64_t &Res) const override;
+  std::error_code getSectionSize(DataRefImpl Sec, uint64_t &Res) const override;
+  std::error_code getSectionContents(DataRefImpl Sec,
+                                     StringRef &Res) const override;
+  std::error_code getSectionAlignment(DataRefImpl Sec,
+                                      uint64_t &Res) const override;
+  std::error_code isSectionText(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionData(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionBSS(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionRequiredForExecution(DataRefImpl Sec,
+                                                bool &Res) const override;
+  std::error_code isSectionVirtual(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionZeroInit(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionReadOnlyData(DataRefImpl Sec,
+                                        bool &Res) const override;
+  std::error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
+                                        bool &Result) const override;
   relocation_iterator section_rel_begin(DataRefImpl Sec) const override;
   relocation_iterator section_rel_end(DataRefImpl Sec) const override;
   section_iterator getRelocatedSection(DataRefImpl Sec) const override;
 
   void moveRelocationNext(DataRefImpl &Rel) const override;
-  error_code getRelocationAddress(DataRefImpl Rel,
-                                  uint64_t &Res) const override;
-  error_code getRelocationOffset(DataRefImpl Rel, uint64_t &Res) const override;
+  std::error_code getRelocationAddress(DataRefImpl Rel,
+                                       uint64_t &Res) const override;
+  std::error_code getRelocationOffset(DataRefImpl Rel,
+                                      uint64_t &Res) const override;
   symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override;
-  error_code getRelocationType(DataRefImpl Rel, uint64_t &Res) const override;
-  error_code getRelocationTypeName(DataRefImpl Rel,
-                                  SmallVectorImpl<char> &Result) const override;
-  error_code getRelocationValueString(DataRefImpl Rel,
-                                  SmallVectorImpl<char> &Result) const override;
+  std::error_code getRelocationType(DataRefImpl Rel,
+                                    uint64_t &Res) const override;
+  std::error_code
+  getRelocationTypeName(DataRefImpl Rel,
+                        SmallVectorImpl<char> &Result) const override;
+  std::error_code
+  getRelocationValueString(DataRefImpl Rel,
+                           SmallVectorImpl<char> &Result) const override;
 
   uint64_t getROffset(DataRefImpl Rel) const;
   StringRef getRelocationTypeName(uint32_t Type) const;
@@ -164,7 +177,8 @@ protected:
   bool isDyldELFObject;
 
 public:
-  ELFObjectFile(MemoryBuffer *Object, error_code &EC, bool BufferOwned = true);
+  ELFObjectFile(MemoryBuffer *Object, std::error_code &EC,
+                bool BufferOwned = true);
 
   const Elf_Sym *getSymbol(DataRefImpl Symb) const;
 
@@ -180,10 +194,9 @@ public:
   library_iterator needed_library_begin() const override;
   library_iterator needed_library_end() const override;
 
-  error_code getRelocationAddend(DataRefImpl Rel, int64_t &Res) const;
-  error_code getSymbolVersion(SymbolRef Symb, StringRef &Version,
-                              bool &IsDefault) const;
-
+  std::error_code getRelocationAddend(DataRefImpl Rel, int64_t &Res) const;
+  std::error_code getSymbolVersion(SymbolRef Symb, StringRef &Version,
+                                   bool &IsDefault) const;
 
   uint8_t getBytesInAddress() const override;
   StringRef getFileFormatName() const override;
@@ -212,8 +225,8 @@ void ELFObjectFile<ELFT>::moveSymbolNext(DataRefImpl &Symb) const {
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getSymbolName(DataRefImpl Symb,
-                                              StringRef &Result) const {
+std::error_code ELFObjectFile<ELFT>::getSymbolName(DataRefImpl Symb,
+                                                   StringRef &Result) const {
   ErrorOr<StringRef> Name = EF.getSymbolName(toELFSymIter(Symb));
   if (!Name)
     return Name.getError();
@@ -222,9 +235,9 @@ error_code ELFObjectFile<ELFT>::getSymbolName(DataRefImpl Symb,
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getSymbolVersion(SymbolRef SymRef,
-                                                 StringRef &Version,
-                                                 bool &IsDefault) const {
+std::error_code ELFObjectFile<ELFT>::getSymbolVersion(SymbolRef SymRef,
+                                                      StringRef &Version,
+                                                      bool &IsDefault) const {
   DataRefImpl Symb = SymRef.getRawDataRefImpl();
   const Elf_Sym *symb = getSymbol(Symb);
   ErrorOr<StringRef> Ver =
@@ -236,8 +249,8 @@ error_code ELFObjectFile<ELFT>::getSymbolVersion(SymbolRef SymRef,
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getSymbolAddress(DataRefImpl Symb,
-                                                 uint64_t &Result) const {
+std::error_code ELFObjectFile<ELFT>::getSymbolAddress(DataRefImpl Symb,
+                                                      uint64_t &Result) const {
   const Elf_Sym *ESym = getSymbol(Symb);
   switch (EF.getSymbolTableIndex(ESym)) {
   case ELF::SHN_COMMON:
@@ -265,8 +278,8 @@ error_code ELFObjectFile<ELFT>::getSymbolAddress(DataRefImpl Symb,
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getSymbolAlignment(DataRefImpl Symb,
-                                                   uint32_t &Res) const {
+std::error_code ELFObjectFile<ELFT>::getSymbolAlignment(DataRefImpl Symb,
+                                                        uint32_t &Res) const {
   Elf_Sym_Iter Sym = toELFSymIter(Symb);
   if (Sym->st_shndx == ELF::SHN_COMMON)
     Res = Sym->st_value;
@@ -276,15 +289,16 @@ error_code ELFObjectFile<ELFT>::getSymbolAlignment(DataRefImpl Symb,
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getSymbolSize(DataRefImpl Symb,
-                                              uint64_t &Result) const {
+std::error_code ELFObjectFile<ELFT>::getSymbolSize(DataRefImpl Symb,
+                                                   uint64_t &Result) const {
   Result = toELFSymIter(Symb)->st_size;
   return object_error::success;
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getSymbolType(DataRefImpl Symb,
-                                              SymbolRef::Type &Result) const {
+std::error_code
+ELFObjectFile<ELFT>::getSymbolType(DataRefImpl Symb,
+                                   SymbolRef::Type &Result) const {
   const Elf_Sym *ESym = getSymbol(Symb);
 
   switch (ESym->getType()) {
@@ -343,8 +357,9 @@ uint32_t ELFObjectFile<ELFT>::getSymbolFlags(DataRefImpl Symb) const {
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getSymbolSection(DataRefImpl Symb,
-                                                 section_iterator &Res) const {
+std::error_code
+ELFObjectFile<ELFT>::getSymbolSection(DataRefImpl Symb,
+                                      section_iterator &Res) const {
   const Elf_Sym *ESym = getSymbol(Symb);
   const Elf_Shdr *ESec = EF.getSection(ESym);
   if (!ESec)
@@ -363,8 +378,8 @@ void ELFObjectFile<ELFT>::moveSectionNext(DataRefImpl &Sec) const {
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getSectionName(DataRefImpl Sec,
-                                               StringRef &Result) const {
+std::error_code ELFObjectFile<ELFT>::getSectionName(DataRefImpl Sec,
+                                                    StringRef &Result) const {
   ErrorOr<StringRef> Name = EF.getSectionName(&*toELFShdrIter(Sec));
   if (!Name)
     return Name.getError();
@@ -373,44 +388,46 @@ error_code ELFObjectFile<ELFT>::getSectionName(DataRefImpl Sec,
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getSectionAddress(DataRefImpl Sec,
-                                                  uint64_t &Result) const {
+std::error_code ELFObjectFile<ELFT>::getSectionAddress(DataRefImpl Sec,
+                                                       uint64_t &Result) const {
   Result = toELFShdrIter(Sec)->sh_addr;
   return object_error::success;
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getSectionSize(DataRefImpl Sec,
-                                               uint64_t &Result) const {
+std::error_code ELFObjectFile<ELFT>::getSectionSize(DataRefImpl Sec,
+                                                    uint64_t &Result) const {
   Result = toELFShdrIter(Sec)->sh_size;
   return object_error::success;
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getSectionContents(DataRefImpl Sec,
-                                                   StringRef &Result) const {
+std::error_code
+ELFObjectFile<ELFT>::getSectionContents(DataRefImpl Sec,
+                                        StringRef &Result) const {
   Elf_Shdr_Iter EShdr = toELFShdrIter(Sec);
   Result = StringRef((const char *)base() + EShdr->sh_offset, EShdr->sh_size);
   return object_error::success;
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getSectionAlignment(DataRefImpl Sec,
-                                                    uint64_t &Result) const {
+std::error_code
+ELFObjectFile<ELFT>::getSectionAlignment(DataRefImpl Sec,
+                                         uint64_t &Result) const {
   Result = toELFShdrIter(Sec)->sh_addralign;
   return object_error::success;
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::isSectionText(DataRefImpl Sec,
-                                              bool &Result) const {
+std::error_code ELFObjectFile<ELFT>::isSectionText(DataRefImpl Sec,
+                                                   bool &Result) const {
   Result = toELFShdrIter(Sec)->sh_flags & ELF::SHF_EXECINSTR;
   return object_error::success;
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::isSectionData(DataRefImpl Sec,
-                                              bool &Result) const {
+std::error_code ELFObjectFile<ELFT>::isSectionData(DataRefImpl Sec,
+                                                   bool &Result) const {
   Elf_Shdr_Iter EShdr = toELFShdrIter(Sec);
   Result = EShdr->sh_flags & (ELF::SHF_ALLOC | ELF::SHF_WRITE) &&
            EShdr->sh_type == ELF::SHT_PROGBITS;
@@ -418,8 +435,8 @@ error_code ELFObjectFile<ELFT>::isSectionData(DataRefImpl Sec,
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::isSectionBSS(DataRefImpl Sec,
-                                             bool &Result) const {
+std::error_code ELFObjectFile<ELFT>::isSectionBSS(DataRefImpl Sec,
+                                                  bool &Result) const {
   Elf_Shdr_Iter EShdr = toELFShdrIter(Sec);
   Result = EShdr->sh_flags & (ELF::SHF_ALLOC | ELF::SHF_WRITE) &&
            EShdr->sh_type == ELF::SHT_NOBITS;
@@ -427,7 +444,7 @@ error_code ELFObjectFile<ELFT>::isSectionBSS(DataRefImpl Sec,
 }
 
 template <class ELFT>
-error_code
+std::error_code
 ELFObjectFile<ELFT>::isSectionRequiredForExecution(DataRefImpl Sec,
                                                    bool &Result) const {
   Result = toELFShdrIter(Sec)->sh_flags & ELF::SHF_ALLOC;
@@ -435,31 +452,31 @@ ELFObjectFile<ELFT>::isSectionRequiredForExecution(DataRefImpl Sec,
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::isSectionVirtual(DataRefImpl Sec,
-                                                 bool &Result) const {
+std::error_code ELFObjectFile<ELFT>::isSectionVirtual(DataRefImpl Sec,
+                                                      bool &Result) const {
   Result = toELFShdrIter(Sec)->sh_type == ELF::SHT_NOBITS;
   return object_error::success;
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::isSectionZeroInit(DataRefImpl Sec,
-                                                  bool &Result) const {
+std::error_code ELFObjectFile<ELFT>::isSectionZeroInit(DataRefImpl Sec,
+                                                       bool &Result) const {
   Result = toELFShdrIter(Sec)->sh_type == ELF::SHT_NOBITS;
   return object_error::success;
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::isSectionReadOnlyData(DataRefImpl Sec,
-                                                      bool &Result) const {
+std::error_code ELFObjectFile<ELFT>::isSectionReadOnlyData(DataRefImpl Sec,
+                                                           bool &Result) const {
   Elf_Shdr_Iter EShdr = toELFShdrIter(Sec);
   Result = !(EShdr->sh_flags & (ELF::SHF_WRITE | ELF::SHF_EXECINSTR));
   return object_error::success;
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::sectionContainsSymbol(DataRefImpl Sec,
-                                                      DataRefImpl Symb,
-                                                      bool &Result) const {
+std::error_code ELFObjectFile<ELFT>::sectionContainsSymbol(DataRefImpl Sec,
+                                                           DataRefImpl Symb,
+                                                           bool &Result) const {
   Elf_Sym_Iter ESym = toELFSymIter(Symb);
 
   uintX_t Index = ESym->st_shndx;
@@ -553,8 +570,9 @@ ELFObjectFile<ELFT>::getRelocationSymbol(DataRefImpl Rel) const {
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getRelocationAddress(DataRefImpl Rel,
-                                                     uint64_t &Result) const {
+std::error_code
+ELFObjectFile<ELFT>::getRelocationAddress(DataRefImpl Rel,
+                                          uint64_t &Result) const {
   uint64_t ROffset = getROffset(Rel);
   const Elf_Ehdr *Header = EF.getHeader();
 
@@ -570,8 +588,9 @@ error_code ELFObjectFile<ELFT>::getRelocationAddress(DataRefImpl Rel,
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getRelocationOffset(DataRefImpl Rel,
-                                                    uint64_t &Result) const {
+std::error_code
+ELFObjectFile<ELFT>::getRelocationOffset(DataRefImpl Rel,
+                                         uint64_t &Result) const {
   assert(EF.getHeader()->e_type == ELF::ET_REL &&
          "Only relocatable object files have relocation offsets");
   Result = getROffset(Rel);
@@ -592,8 +611,8 @@ uint64_t ELFObjectFile<ELFT>::getROffset(DataRefImpl Rel) const {
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getRelocationType(DataRefImpl Rel,
-                                                  uint64_t &Result) const {
+std::error_code ELFObjectFile<ELFT>::getRelocationType(DataRefImpl Rel,
+                                                       uint64_t &Result) const {
   const Elf_Shdr *sec = getRelSection(Rel);
   switch (sec->sh_type) {
   default:
@@ -616,7 +635,7 @@ StringRef ELFObjectFile<ELFT>::getRelocationTypeName(uint32_t Type) const {
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getRelocationTypeName(
+std::error_code ELFObjectFile<ELFT>::getRelocationTypeName(
     DataRefImpl Rel, SmallVectorImpl<char> &Result) const {
   const Elf_Shdr *sec = getRelSection(Rel);
   uint32_t type;
@@ -638,8 +657,9 @@ error_code ELFObjectFile<ELFT>::getRelocationTypeName(
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getRelocationAddend(DataRefImpl Rel,
-                                                    int64_t &Result) const {
+std::error_code
+ELFObjectFile<ELFT>::getRelocationAddend(DataRefImpl Rel,
+                                         int64_t &Result) const {
   const Elf_Shdr *sec = getRelSection(Rel);
   switch (sec->sh_type) {
   default:
@@ -656,7 +676,7 @@ error_code ELFObjectFile<ELFT>::getRelocationAddend(DataRefImpl Rel,
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getRelocationValueString(
+std::error_code ELFObjectFile<ELFT>::getRelocationValueString(
     DataRefImpl Rel, SmallVectorImpl<char> &Result) const {
   const Elf_Shdr *sec = getRelSection(Rel);
   uint8_t type;
@@ -754,7 +774,7 @@ ELFObjectFile<ELFT>::getRela(DataRefImpl Rela) const {
 }
 
 template <class ELFT>
-ELFObjectFile<ELFT>::ELFObjectFile(MemoryBuffer *Object, error_code &ec,
+ELFObjectFile<ELFT>::ELFObjectFile(MemoryBuffer *Object, std::error_code &ec,
                                    bool BufferOwned)
     : ObjectFile(getELFType(static_cast<endianness>(ELFT::TargetEndianness) ==
                                 support::little,
@@ -817,8 +837,8 @@ library_iterator ELFObjectFile<ELFT>::needed_library_begin() const {
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getLibraryNext(DataRefImpl Data,
-                                               LibraryRef &Result) const {
+std::error_code ELFObjectFile<ELFT>::getLibraryNext(DataRefImpl Data,
+                                                    LibraryRef &Result) const {
   Elf_Dyn_Iter DI = toELFDynIter(Data);
   Elf_Dyn_Iter DE = EF.end_dynamic_table();
 
@@ -832,8 +852,8 @@ error_code ELFObjectFile<ELFT>::getLibraryNext(DataRefImpl Data,
 }
 
 template <class ELFT>
-error_code ELFObjectFile<ELFT>::getLibraryPath(DataRefImpl Data,
-                                               StringRef &Res) const {
+std::error_code ELFObjectFile<ELFT>::getLibraryPath(DataRefImpl Data,
+                                                    StringRef &Res) const {
   Res = EF.getDynamicString(toELFDynIter(Data)->getVal());
   return object_error::success;
 }
@@ -931,8 +951,8 @@ unsigned ELFObjectFile<ELFT>::getArch() const {
 
 /// FIXME: Maybe we should have a base ElfObjectFile that is not a template
 /// and make these member functions?
-inline error_code getELFRelocationAddend(const RelocationRef R,
-                                         int64_t &Addend) {
+inline std::error_code getELFRelocationAddend(const RelocationRef R,
+                                              int64_t &Addend) {
   const ObjectFile *Obj = R.getObjectFile();
   DataRefImpl DRI = R.getRawDataRefImpl();
   // Little-endian 32-bit
@@ -975,9 +995,10 @@ getELFDynamicSymbolIterators(SymbolicFile *Obj) {
 
 /// This is a generic interface for retrieving GNU symbol version
 /// information from an ELFObjectFile.
-inline error_code GetELFSymbolVersion(const ObjectFile *Obj,
-                                      const SymbolRef &Sym, StringRef &Version,
-                                      bool &IsDefault) {
+inline std::error_code GetELFSymbolVersion(const ObjectFile *Obj,
+                                           const SymbolRef &Sym,
+                                           StringRef &Version,
+                                           bool &IsDefault) {
   // Little-endian 32-bit
   if (const ELF32LEObjectFile *ELFObj = dyn_cast<ELF32LEObjectFile>(Obj))
     return ELFObj->getSymbolVersion(Sym, Version, IsDefault);
index 4d969393db23f756691f7ea5f8c34814263c15f8..701da1272cd53d6b897bd72e55b94b4e6303f703 100644 (file)
@@ -17,7 +17,6 @@
 #include <system_error>
 
 namespace llvm {
-using std::error_code;
 namespace object {
 
 const std::error_category &object_category();
@@ -30,8 +29,8 @@ enum class object_error {
   unexpected_eof
 };
 
-inline error_code make_error_code(object_error e) {
-  return error_code(static_cast<int>(e), object_category());
+inline std::error_code make_error_code(object_error e) {
+  return std::error_code(static_cast<int>(e), object_category());
 }
 
 } // end namespace object.
index 78f5b2b64f23afd4f1976e4c352ea9c5acc66cf8..c87fe1519acc29a58bb9f9644050fabd93fb4b19 100644 (file)
@@ -27,10 +27,11 @@ class IRObjectFile : public SymbolicFile {
   std::unique_ptr<Mangler> Mang;
 
 public:
-  IRObjectFile(MemoryBuffer *Object, error_code &EC, LLVMContext &Context,
+  IRObjectFile(MemoryBuffer *Object, std::error_code &EC, LLVMContext &Context,
                bool BufferOwned);
   void moveSymbolNext(DataRefImpl &Symb) const override;
-  error_code printSymbolName(raw_ostream &OS, DataRefImpl Symb) const override;
+  std::error_code printSymbolName(raw_ostream &OS,
+                                  DataRefImpl Symb) const override;
   uint32_t getSymbolFlags(DataRefImpl Symb) const override;
   const GlobalValue &getSymbolGV(DataRefImpl Symb) const;
   basic_symbol_iterator symbol_begin_impl() const override;
index ab5b462e01e36ac620604798b38f68d09b6af6f4..6e1ab253ec9bc1c3f853ee344a679806ed19a45a 100644 (file)
@@ -40,9 +40,9 @@ public:
 
   void moveNext();
 
-  error_code getOffset(uint32_t &Result) const;
-  error_code getLength(uint16_t &Result) const;
-  error_code getKind(uint16_t &Result) const;
+  std::error_code getOffset(uint32_t &Result) const;
+  std::error_code getLength(uint16_t &Result) const;
+  std::error_code getKind(uint16_t &Result) const;
 
   DataRefImpl getRawDataRefImpl() const;
   const ObjectFile *getObjectFile() const;
@@ -57,60 +57,74 @@ public:
   };
 
   MachOObjectFile(MemoryBuffer *Object, bool IsLittleEndian, bool Is64Bits,
-                  error_code &EC, bool BufferOwned = true);
+                  std::error_code &EC, bool BufferOwned = true);
 
   void moveSymbolNext(DataRefImpl &Symb) const override;
-  error_code getSymbolName(DataRefImpl Symb, StringRef &Res) const override;
+  std::error_code getSymbolName(DataRefImpl Symb,
+                                StringRef &Res) const override;
 
   // MachO specific.
-  error_code getIndirectName(DataRefImpl Symb, StringRef &Res) const;
-
-  error_code getSymbolAddress(DataRefImpl Symb, uint64_t &Res) const override;
-  error_code getSymbolAlignment(DataRefImpl Symb, uint32_t &Res) const override;
-  error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const override;
-  error_code getSymbolType(DataRefImpl Symb,
-                           SymbolRef::Type &Res) const override;
+  std::error_code getIndirectName(DataRefImpl Symb, StringRef &Res) const;
+
+  std::error_code getSymbolAddress(DataRefImpl Symb,
+                                   uint64_t &Res) const override;
+  std::error_code getSymbolAlignment(DataRefImpl Symb,
+                                     uint32_t &Res) const override;
+  std::error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const override;
+  std::error_code getSymbolType(DataRefImpl Symb,
+                                SymbolRef::Type &Res) const override;
   uint32_t getSymbolFlags(DataRefImpl Symb) const override;
-  error_code getSymbolSection(DataRefImpl Symb,
-                              section_iterator &Res) const override;
+  std::error_code getSymbolSection(DataRefImpl Symb,
+                                   section_iterator &Res) const override;
 
   void moveSectionNext(DataRefImpl &Sec) const override;
-  error_code getSectionName(DataRefImpl Sec, StringRef &Res) const override;
-  error_code getSectionAddress(DataRefImpl Sec, uint64_t &Res) const override;
-  error_code getSectionSize(DataRefImpl Sec, uint64_t &Res) const override;
-  error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const override;
-  error_code getSectionAlignment(DataRefImpl Sec, uint64_t &Res) const override;
-  error_code isSectionText(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionData(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionBSS(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionRequiredForExecution(DataRefImpl Sec,
-                                           bool &Res) const override;
-  error_code isSectionVirtual(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionZeroInit(DataRefImpl Sec, bool &Res) const override;
-  error_code isSectionReadOnlyData(DataRefImpl Sec, bool &Res) const override;
-  error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
-                                   bool &Result) const override;
+  std::error_code getSectionName(DataRefImpl Sec,
+                                 StringRef &Res) const override;
+  std::error_code getSectionAddress(DataRefImpl Sec,
+                                    uint64_t &Res) const override;
+  std::error_code getSectionSize(DataRefImpl Sec, uint64_t &Res) const override;
+  std::error_code getSectionContents(DataRefImpl Sec,
+                                     StringRef &Res) const override;
+  std::error_code getSectionAlignment(DataRefImpl Sec,
+                                      uint64_t &Res) const override;
+  std::error_code isSectionText(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionData(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionBSS(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionRequiredForExecution(DataRefImpl Sec,
+                                                bool &Res) const override;
+  std::error_code isSectionVirtual(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionZeroInit(DataRefImpl Sec, bool &Res) const override;
+  std::error_code isSectionReadOnlyData(DataRefImpl Sec,
+                                        bool &Res) const override;
+  std::error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
+                                        bool &Result) const override;
   relocation_iterator section_rel_begin(DataRefImpl Sec) const override;
   relocation_iterator section_rel_end(DataRefImpl Sec) const override;
 
   void moveRelocationNext(DataRefImpl &Rel) const override;
-  error_code getRelocationAddress(DataRefImpl Rel,
-                                  uint64_t &Res) const override;
-  error_code getRelocationOffset(DataRefImpl Rel, uint64_t &Res) const override;
+  std::error_code getRelocationAddress(DataRefImpl Rel,
+                                       uint64_t &Res) const override;
+  std::error_code getRelocationOffset(DataRefImpl Rel,
+                                      uint64_t &Res) const override;
   symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override;
-  error_code getRelocationType(DataRefImpl Rel, uint64_t &Res) const override;
-  error_code getRelocationTypeName(DataRefImpl Rel,
-                                  SmallVectorImpl<char> &Result) const override;
-  error_code getRelocationValueString(DataRefImpl Rel,
-                                  SmallVectorImpl<char> &Result) const override;
-  error_code getRelocationHidden(DataRefImpl Rel, bool &Result) const override;
-
-  error_code getLibraryNext(DataRefImpl LibData,
-                            LibraryRef &Res) const override;
-  error_code getLibraryPath(DataRefImpl LibData, StringRef &Res) const override;
+  std::error_code getRelocationType(DataRefImpl Rel,
+                                    uint64_t &Res) const override;
+  std::error_code
+  getRelocationTypeName(DataRefImpl Rel,
+                        SmallVectorImpl<char> &Result) const override;
+  std::error_code
+  getRelocationValueString(DataRefImpl Rel,
+                           SmallVectorImpl<char> &Result) const override;
+  std::error_code getRelocationHidden(DataRefImpl Rel,
+                                      bool &Result) const override;
+
+  std::error_code getLibraryNext(DataRefImpl LibData,
+                                 LibraryRef &Res) const override;
+  std::error_code getLibraryPath(DataRefImpl LibData,
+                                 StringRef &Res) const override;
 
   // MachO specific.
-  error_code getLibraryShortNameByIndex(unsigned Index, StringRef &Res);
+  std::error_code getLibraryShortNameByIndex(unsigned Index, StringRef &Res);
 
   // TODO: Would be useful to have an iterator based version
   // of the load command interface too.
@@ -248,7 +262,7 @@ inline void DiceRef::moveNext() {
 // the OwningObject ObjectFile is a MachOObjectFile a static_cast<> is used for
 // the methods that get the values of the fields of the reference.
 
-inline error_code DiceRef::getOffset(uint32_t &Result) const {
+inline std::error_code DiceRef::getOffset(uint32_t &Result) const {
   const MachOObjectFile *MachOOF =
     static_cast<const MachOObjectFile *>(OwningObject);
   MachO::data_in_code_entry Dice = MachOOF->getDice(DicePimpl);
@@ -256,7 +270,7 @@ inline error_code DiceRef::getOffset(uint32_t &Result) const {
   return object_error::success;
 }
 
-inline error_code DiceRef::getLength(uint16_t &Result) const {
+inline std::error_code DiceRef::getLength(uint16_t &Result) const {
   const MachOObjectFile *MachOOF =
     static_cast<const MachOObjectFile *>(OwningObject);
   MachO::data_in_code_entry Dice = MachOOF->getDice(DicePimpl);
@@ -264,7 +278,7 @@ inline error_code DiceRef::getLength(uint16_t &Result) const {
   return object_error::success;
 }
 
-inline error_code DiceRef::getKind(uint16_t &Result) const {
+inline std::error_code DiceRef::getKind(uint16_t &Result) const {
   const MachOObjectFile *MachOOF =
     static_cast<const MachOObjectFile *>(OwningObject);
   MachO::data_in_code_entry Dice = MachOOF->getDice(DicePimpl);
index d27c824a87a0b7b0a97e72572d0066cd72471d37..47e93c26b46a26609cfbeed8506e0c97bda12a97 100644 (file)
@@ -53,9 +53,9 @@ public:
     ObjectForArch getNext() const { return ObjectForArch(Parent, Index + 1); }
     uint32_t getCPUType() const { return Header.cputype; }
 
-    error_code getAsObjectFile(std::unique_ptr<ObjectFile> &Result) const;
+    std::error_code getAsObjectFile(std::unique_ptr<ObjectFile> &Result) const;
 
-    error_code getAsArchive(std::unique_ptr<Archive> &Result) const;
+    std::error_code getAsArchive(std::unique_ptr<Archive> &Result) const;
   };
 
   class object_iterator {
@@ -79,7 +79,7 @@ public:
     }
   };
 
-  MachOUniversalBinary(MemoryBuffer *Source, error_code &ec);
+  MachOUniversalBinary(MemoryBuffer *Source, std::error_code &ec);
   static ErrorOr<MachOUniversalBinary*> create(MemoryBuffer *Source);
 
   object_iterator begin_objects() const {
@@ -96,8 +96,8 @@ public:
     return V->isMachOUniversalBinary();
   }
 
-  error_code getObjectForArch(Triple::ArchType Arch,
-                              std::unique_ptr<ObjectFile> &Result) const;
+  std::error_code getObjectForArch(Triple::ArchType Arch,
+                                   std::unique_ptr<ObjectFile> &Result) const;
 };
 
 }
index 10209b90c05a886957cfa42d554e4e62bcde00f2..152bb7e10c1f63af46217ec12392e5a0f8634c93 100644 (file)
@@ -46,26 +46,26 @@ public:
 
   void moveNext();
 
-  error_code getAddress(uint64_t &Result) const;
-  error_code getOffset(uint64_t &Result) const;
+  std::error_code getAddress(uint64_t &Result) const;
+  std::error_code getOffset(uint64_t &Result) const;
   symbol_iterator getSymbol() const;
-  error_code getType(uint64_t &Result) const;
+  std::error_code getType(uint64_t &Result) const;
 
   /// @brief Indicates whether this relocation should hidden when listing
   /// relocations, usually because it is the trailing part of a multipart
   /// relocation that will be printed as part of the leading relocation.
-  error_code getHidden(bool &Result) const;
+  std::error_code getHidden(bool &Result) const;
 
   /// @brief Get a string that represents the type of this relocation.
   ///
   /// This is for display purposes only.
-  error_code getTypeName(SmallVectorImpl<char> &Result) const;
+  std::error_code getTypeName(SmallVectorImpl<char> &Result) const;
 
   /// @brief Get a string that represents the calculation of the value of this
   ///        relocation.
   ///
   /// This is for display purposes only.
-  error_code getValueString(SmallVectorImpl<char> &Result) const;
+  std::error_code getValueString(SmallVectorImpl<char> &Result) const;
 
   DataRefImpl getRawDataRefImpl() const;
   const ObjectFile *getObjectFile() const;
@@ -92,24 +92,24 @@ public:
 
   void moveNext();
 
-  error_code getName(StringRef &Result) const;
-  error_code getAddress(uint64_t &Result) const;
-  error_code getSize(uint64_t &Result) const;
-  error_code getContents(StringRef &Result) const;
+  std::error_code getName(StringRef &Result) const;
+  std::error_code getAddress(uint64_t &Result) const;
+  std::error_code getSize(uint64_t &Result) const;
+  std::error_code getContents(StringRef &Result) const;
 
   /// @brief Get the alignment of this section as the actual value (not log 2).
-  error_code getAlignment(uint64_t &Result) const;
+  std::error_code getAlignment(uint64_t &Result) const;
 
   // FIXME: Move to the normalization layer when it's created.
-  error_code isText(bool &Result) const;
-  error_code isData(bool &Result) const;
-  error_code isBSS(bool &Result) const;
-  error_code isRequiredForExecution(bool &Result) const;
-  error_code isVirtual(bool &Result) const;
-  error_code isZeroInit(bool &Result) const;
-  error_code isReadOnlyData(bool &Result) const;
+  std::error_code isText(bool &Result) const;
+  std::error_code isData(bool &Result) const;
+  std::error_code isBSS(bool &Result) const;
+  std::error_code isRequiredForExecution(bool &Result) const;
+  std::error_code isVirtual(bool &Result) const;
+  std::error_code isZeroInit(bool &Result) const;
+  std::error_code isReadOnlyData(bool &Result) const;
 
-  error_code containsSymbol(SymbolRef S, bool &Result) const;
+  std::error_code containsSymbol(SymbolRef S, bool &Result) const;
 
   relocation_iterator relocation_begin() const;
   relocation_iterator relocation_end() const;
@@ -141,18 +141,18 @@ public:
 
   SymbolRef(DataRefImpl SymbolP, const ObjectFile *Owner);
 
-  error_code getName(StringRef &Result) const;
+  std::error_code getName(StringRef &Result) const;
   /// Returns the symbol virtual address (i.e. address at which it will be
   /// mapped).
-  error_code getAddress(uint64_t &Result) const;
+  std::error_code getAddress(uint64_t &Result) const;
   /// @brief Get the alignment of this symbol as the actual value (not log 2).
-  error_code getAlignment(uint32_t &Result) const;
-  error_code getSize(uint64_t &Result) const;
-  error_code getType(SymbolRef::Type &Result) const;
+  std::error_code getAlignment(uint32_t &Result) const;
+  std::error_code getSize(uint64_t &Result) const;
+  std::error_code getType(SymbolRef::Type &Result) const;
 
   /// @brief Get section this symbol is defined in reference to. Result is
   /// end_sections() if it is undefined or is an absolute symbol.
-  error_code getSection(section_iterator &Result) const;
+  std::error_code getSection(section_iterator &Result) const;
 
   const ObjectFile *getObject() const;
 };
@@ -190,10 +190,10 @@ public:
   bool operator==(const LibraryRef &Other) const;
   bool operator<(const LibraryRef &Other) const;
 
-  error_code getNext(LibraryRef &Result) const;
+  std::error_code getNext(LibraryRef &Result) const;
 
   // Get the path to this library, as stored in the object file.
-  error_code getPath(StringRef &Result) const;
+  std::error_code getPath(StringRef &Result) const;
 
   DataRefImpl getRawDataRefImpl() const;
 };
@@ -223,35 +223,49 @@ protected:
   // Implementations assume that the DataRefImpl is valid and has not been
   // modified externally. It's UB otherwise.
   friend class SymbolRef;
-  virtual error_code getSymbolName(DataRefImpl Symb, StringRef &Res) const = 0;
-  error_code printSymbolName(raw_ostream &OS, DataRefImpl Symb) const override;
-  virtual error_code getSymbolAddress(DataRefImpl Symb, uint64_t &Res) const = 0;
-  virtual error_code getSymbolAlignment(DataRefImpl Symb, uint32_t &Res) const;
-  virtual error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const = 0;
-  virtual error_code getSymbolType(DataRefImpl Symb,
-                                   SymbolRef::Type &Res) const = 0;
-  virtual error_code getSymbolSection(DataRefImpl Symb,
-                                      section_iterator &Res) const = 0;
+  virtual std::error_code getSymbolName(DataRefImpl Symb,
+                                        StringRef &Res) const = 0;
+  std::error_code printSymbolName(raw_ostream &OS,
+                                  DataRefImpl Symb) const override;
+  virtual std::error_code getSymbolAddress(DataRefImpl Symb,
+                                           uint64_t &Res) const = 0;
+  virtual std::error_code getSymbolAlignment(DataRefImpl Symb,
+                                             uint32_t &Res) const;
+  virtual std::error_code getSymbolSize(DataRefImpl Symb,
+                                        uint64_t &Res) const = 0;
+  virtual std::error_code getSymbolType(DataRefImpl Symb,
+                                        SymbolRef::Type &Res) const = 0;
+  virtual std::error_code getSymbolSection(DataRefImpl Symb,
+                                           section_iterator &Res) const = 0;
 
   // Same as above for SectionRef.
   friend class SectionRef;
   virtual void moveSectionNext(DataRefImpl &Sec) const = 0;
-  virtual error_code getSectionName(DataRefImpl Sec, StringRef &Res) const = 0;
-  virtual error_code getSectionAddress(DataRefImpl Sec, uint64_t &Res) const =0;
-  virtual error_code getSectionSize(DataRefImpl Sec, uint64_t &Res) const = 0;
-  virtual error_code getSectionContents(DataRefImpl Sec, StringRef &Res)const=0;
-  virtual error_code getSectionAlignment(DataRefImpl Sec, uint64_t &Res)const=0;
-  virtual error_code isSectionText(DataRefImpl Sec, bool &Res) const = 0;
-  virtual error_code isSectionData(DataRefImpl Sec, bool &Res) const = 0;
-  virtual error_code isSectionBSS(DataRefImpl Sec, bool &Res) const = 0;
-  virtual error_code isSectionRequiredForExecution(DataRefImpl Sec,
-                                                   bool &Res) const = 0;
+  virtual std::error_code getSectionName(DataRefImpl Sec,
+                                         StringRef &Res) const = 0;
+  virtual std::error_code getSectionAddress(DataRefImpl Sec,
+                                            uint64_t &Res) const = 0;
+  virtual std::error_code getSectionSize(DataRefImpl Sec,
+                                         uint64_t &Res) const = 0;
+  virtual std::error_code getSectionContents(DataRefImpl Sec,
+                                             StringRef &Res) const = 0;
+  virtual std::error_code getSectionAlignment(DataRefImpl Sec,
+                                              uint64_t &Res) const = 0;
+  virtual std::error_code isSectionText(DataRefImpl Sec, bool &Res) const = 0;
+  virtual std::error_code isSectionData(DataRefImpl Sec, bool &Res) const = 0;
+  virtual std::error_code isSectionBSS(DataRefImpl Sec, bool &Res) const = 0;
+  virtual std::error_code isSectionRequiredForExecution(DataRefImpl Sec,
+                                                        bool &Res) const = 0;
   // A section is 'virtual' if its contents aren't present in the object image.
-  virtual error_code isSectionVirtual(DataRefImpl Sec, bool &Res) const = 0;
-  virtual error_code isSectionZeroInit(DataRefImpl Sec, bool &Res) const = 0;
-  virtual error_code isSectionReadOnlyData(DataRefImpl Sec, bool &Res) const =0;
-  virtual error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
-                                           bool &Result) const = 0;
+  virtual std::error_code isSectionVirtual(DataRefImpl Sec,
+                                           bool &Res) const = 0;
+  virtual std::error_code isSectionZeroInit(DataRefImpl Sec,
+                                            bool &Res) const = 0;
+  virtual std::error_code isSectionReadOnlyData(DataRefImpl Sec,
+                                                bool &Res) const = 0;
+  virtual std::error_code sectionContainsSymbol(DataRefImpl Sec,
+                                                DataRefImpl Symb,
+                                                bool &Result) const = 0;
   virtual relocation_iterator section_rel_begin(DataRefImpl Sec) const = 0;
   virtual relocation_iterator section_rel_end(DataRefImpl Sec) const = 0;
   virtual section_iterator getRelocatedSection(DataRefImpl Sec) const;
@@ -259,26 +273,31 @@ protected:
   // Same as above for RelocationRef.
   friend class RelocationRef;
   virtual void moveRelocationNext(DataRefImpl &Rel) const = 0;
-  virtual error_code getRelocationAddress(DataRefImpl Rel,
-                                          uint64_t &Res) const =0;
-  virtual error_code getRelocationOffset(DataRefImpl Rel,
-                                         uint64_t &Res) const =0;
+  virtual std::error_code getRelocationAddress(DataRefImpl Rel,
+                                               uint64_t &Res) const = 0;
+  virtual std::error_code getRelocationOffset(DataRefImpl Rel,
+                                              uint64_t &Res) const = 0;
   virtual symbol_iterator getRelocationSymbol(DataRefImpl Rel) const = 0;
-  virtual error_code getRelocationType(DataRefImpl Rel,
-                                       uint64_t &Res) const = 0;
-  virtual error_code getRelocationTypeName(DataRefImpl Rel,
-                                       SmallVectorImpl<char> &Result) const = 0;
-  virtual error_code getRelocationValueString(DataRefImpl Rel,
-                                       SmallVectorImpl<char> &Result) const = 0;
-  virtual error_code getRelocationHidden(DataRefImpl Rel, bool &Result) const {
+  virtual std::error_code getRelocationType(DataRefImpl Rel,
+                                            uint64_t &Res) const = 0;
+  virtual std::error_code
+  getRelocationTypeName(DataRefImpl Rel,
+                        SmallVectorImpl<char> &Result) const = 0;
+  virtual std::error_code
+  getRelocationValueString(DataRefImpl Rel,
+                           SmallVectorImpl<char> &Result) const = 0;
+  virtual std::error_code getRelocationHidden(DataRefImpl Rel,
+                                              bool &Result) const {
     Result = false;
     return object_error::success;
   }
 
   // Same for LibraryRef
   friend class LibraryRef;
-  virtual error_code getLibraryNext(DataRefImpl Lib, LibraryRef &Res) const = 0;
-  virtual error_code getLibraryPath(DataRefImpl Lib, StringRef &Res) const = 0;
+  virtual std::error_code getLibraryNext(DataRefImpl Lib,
+                                         LibraryRef &Res) const = 0;
+  virtual std::error_code getLibraryPath(DataRefImpl Lib,
+                                         StringRef &Res) const = 0;
 
 public:
   typedef iterator_range<symbol_iterator> symbol_iterator_range;
@@ -339,27 +358,27 @@ public:
 inline SymbolRef::SymbolRef(DataRefImpl SymbolP, const ObjectFile *Owner)
     : BasicSymbolRef(SymbolP, Owner) {}
 
-inline error_code SymbolRef::getName(StringRef &Result) const {
+inline std::error_code SymbolRef::getName(StringRef &Result) const {
   return getObject()->getSymbolName(getRawDataRefImpl(), Result);
 }
 
-inline error_code SymbolRef::getAddress(uint64_t &Result) const {
+inline std::error_code SymbolRef::getAddress(uint64_t &Result) const {
   return getObject()->getSymbolAddress(getRawDataRefImpl(), Result);
 }
 
-inline error_code SymbolRef::getAlignment(uint32_t &Result) const {
+inline std::error_code SymbolRef::getAlignment(uint32_t &Result) const {
   return getObject()->getSymbolAlignment(getRawDataRefImpl(), Result);
 }
 
-inline error_code SymbolRef::getSize(uint64_t &Result) const {
+inline std::error_code SymbolRef::getSize(uint64_t &Result) const {
   return getObject()->getSymbolSize(getRawDataRefImpl(), Result);
 }
 
-inline error_code SymbolRef::getSection(section_iterator &Result) const {
+inline std::error_code SymbolRef::getSection(section_iterator &Result) const {
   return getObject()->getSymbolSection(getRawDataRefImpl(), Result);
 }
 
-inline error_code SymbolRef::getType(SymbolRef::Type &Result) const {
+inline std::error_code SymbolRef::getType(SymbolRef::Type &Result) const {
   return getObject()->getSymbolType(getRawDataRefImpl(), Result);
 }
 
@@ -391,55 +410,56 @@ inline void SectionRef::moveNext() {
   return OwningObject->moveSectionNext(SectionPimpl);
 }
 
-inline error_code SectionRef::getName(StringRef &Result) const {
+inline std::error_code SectionRef::getName(StringRef &Result) const {
   return OwningObject->getSectionName(SectionPimpl, Result);
 }
 
-inline error_code SectionRef::getAddress(uint64_t &Result) const {
+inline std::error_code SectionRef::getAddress(uint64_t &Result) const {
   return OwningObject->getSectionAddress(SectionPimpl, Result);
 }
 
-inline error_code SectionRef::getSize(uint64_t &Result) const {
+inline std::error_code SectionRef::getSize(uint64_t &Result) const {
   return OwningObject->getSectionSize(SectionPimpl, Result);
 }
 
-inline error_code SectionRef::getContents(StringRef &Result) const {
+inline std::error_code SectionRef::getContents(StringRef &Result) const {
   return OwningObject->getSectionContents(SectionPimpl, Result);
 }
 
-inline error_code SectionRef::getAlignment(uint64_t &Result) const {
+inline std::error_code SectionRef::getAlignment(uint64_t &Result) const {
   return OwningObject->getSectionAlignment(SectionPimpl, Result);
 }
 
-inline error_code SectionRef::isText(bool &Result) const {
+inline std::error_code SectionRef::isText(bool &Result) const {
   return OwningObject->isSectionText(SectionPimpl, Result);
 }
 
-inline error_code SectionRef::isData(bool &Result) const {
+inline std::error_code SectionRef::isData(bool &Result) const {
   return OwningObject->isSectionData(SectionPimpl, Result);
 }
 
-inline error_code SectionRef::isBSS(bool &Result) const {
+inline std::error_code SectionRef::isBSS(bool &Result) const {
   return OwningObject->isSectionBSS(SectionPimpl, Result);
 }
 
-inline error_code SectionRef::isRequiredForExecution(bool &Result) const {
+inline std::error_code SectionRef::isRequiredForExecution(bool &Result) const {
   return OwningObject->isSectionRequiredForExecution(SectionPimpl, Result);
 }
 
-inline error_code SectionRef::isVirtual(bool &Result) const {
+inline std::error_code SectionRef::isVirtual(bool &Result) const {
   return OwningObject->isSectionVirtual(SectionPimpl, Result);
 }
 
-inline error_code SectionRef::isZeroInit(bool &Result) const {
+inline std::error_code SectionRef::isZeroInit(bool &Result) const {
   return OwningObject->isSectionZeroInit(SectionPimpl, Result);
 }
 
-inline error_code SectionRef::isReadOnlyData(bool &Result) const {
+inline std::error_code SectionRef::isReadOnlyData(bool &Result) const {
   return OwningObject->isSectionReadOnlyData(SectionPimpl, Result);
 }
 
-inline error_code SectionRef::containsSymbol(SymbolRef S, bool &Result) const {
+inline std::error_code SectionRef::containsSymbol(SymbolRef S,
+                                                  bool &Result) const {
   return OwningObject->sectionContainsSymbol(SectionPimpl,
                                              S.getRawDataRefImpl(), Result);
 }
@@ -474,11 +494,11 @@ inline void RelocationRef::moveNext() {
   return OwningObject->moveRelocationNext(RelocationPimpl);
 }
 
-inline error_code RelocationRef::getAddress(uint64_t &Result) const {
+inline std::error_code RelocationRef::getAddress(uint64_t &Result) const {
   return OwningObject->getRelocationAddress(RelocationPimpl, Result);
 }
 
-inline error_code RelocationRef::getOffset(uint64_t &Result) const {
+inline std::error_code RelocationRef::getOffset(uint64_t &Result) const {
   return OwningObject->getRelocationOffset(RelocationPimpl, Result);
 }
 
@@ -486,21 +506,21 @@ inline symbol_iterator RelocationRef::getSymbol() const {
   return OwningObject->getRelocationSymbol(RelocationPimpl);
 }
 
-inline error_code RelocationRef::getType(uint64_t &Result) const {
+inline std::error_code RelocationRef::getType(uint64_t &Result) const {
   return OwningObject->getRelocationType(RelocationPimpl, Result);
 }
 
-inline error_code RelocationRef::getTypeName(SmallVectorImpl<char> &Result)
-  const {
+inline std::error_code
+RelocationRef::getTypeName(SmallVectorImpl<char> &Result) const {
   return OwningObject->getRelocationTypeName(RelocationPimpl, Result);
 }
 
-inline error_code RelocationRef::getValueString(SmallVectorImpl<char> &Result)
-  const {
+inline std::error_code
+RelocationRef::getValueString(SmallVectorImpl<char> &Result) const {
   return OwningObject->getRelocationValueString(RelocationPimpl, Result);
 }
 
-inline error_code RelocationRef::getHidden(bool &Result) const {
+inline std::error_code RelocationRef::getHidden(bool &Result) const {
   return OwningObject->getRelocationHidden(RelocationPimpl, Result);
 }
 
@@ -525,11 +545,11 @@ inline bool LibraryRef::operator<(const LibraryRef &Other) const {
   return LibraryPimpl < Other.LibraryPimpl;
 }
 
-inline error_code LibraryRef::getNext(LibraryRef &Result) const {
+inline std::error_code LibraryRef::getNext(LibraryRef &Result) const {
   return OwningObject->getLibraryNext(LibraryPimpl, Result);
 }
 
-inline error_code LibraryRef::getPath(StringRef &Result) const {
+inline std::error_code LibraryRef::getPath(StringRef &Result) const {
   return OwningObject->getLibraryPath(LibraryPimpl, Result);
 }
 
index 0801f46d560e76e366c553cdc90db650913100ef..1133736945562ed6c230080271e7250a78163452 100644 (file)
@@ -99,7 +99,7 @@ public:
 
   void moveNext();
 
-  error_code printName(raw_ostream &OS) const;
+  std::error_code printName(raw_ostream &OS) const;
 
   /// Get symbol flags (bitwise OR of SymbolRef::Flags)
   uint32_t getFlags() const;
@@ -120,8 +120,8 @@ public:
   // virtual interface.
   virtual void moveSymbolNext(DataRefImpl &Symb) const = 0;
 
-  virtual error_code printSymbolName(raw_ostream &OS,
-                                     DataRefImpl Symb) const = 0;
+  virtual std::error_code printSymbolName(raw_ostream &OS,
+                                          DataRefImpl Symb) const = 0;
 
   virtual uint32_t getSymbolFlags(DataRefImpl Symb) const = 0;
 
@@ -174,7 +174,7 @@ inline void BasicSymbolRef::moveNext() {
   return OwningObject->moveSymbolNext(SymbolPimpl);
 }
 
-inline error_code BasicSymbolRef::printName(raw_ostream &OS) const {
+inline std::error_code BasicSymbolRef::printName(raw_ostream &OS) const {
   return OwningObject->printSymbolName(OS, SymbolPimpl);
 }
 
index a3413d700843e9f662230b8c3d0188d294b7bf65..eafb76886c83e8ff4697846e388213dedf9aa7cc 100644 (file)
@@ -19,7 +19,6 @@
 #include <system_error>
 
 namespace llvm {
-using std::error_code;
 const std::error_category &instrprof_category();
 
 enum class instrprof_error {
@@ -38,8 +37,8 @@ enum class instrprof_error {
     counter_overflow
 };
 
-inline error_code make_error_code(instrprof_error E) {
-  return error_code(static_cast<int>(E), instrprof_category());
+inline std::error_code make_error_code(instrprof_error E) {
+  return std::error_code(static_cast<int>(E), instrprof_category());
 }
 
 } // end namespace llvm
index 3e18c76c57df5bd8519e7e681fd664dfe292a0e9..14e747af8071d60bd41318519259eda836131552 100644 (file)
@@ -60,28 +60,29 @@ public:
 /// Base class and interface for reading profiling data of any known instrprof
 /// format. Provides an iterator over InstrProfRecords.
 class InstrProfReader {
-  error_code LastError;
+  std::error_code LastError;
+
 public:
   InstrProfReader() : LastError(instrprof_error::success) {}
   virtual ~InstrProfReader() {}
 
   /// Read the header.  Required before reading first record.
-  virtual error_code readHeader() = 0;
+  virtual std::error_code readHeader() = 0;
   /// Read a single record.
-  virtual error_code readNextRecord(InstrProfRecord &Record) = 0;
+  virtual std::error_code readNextRecord(InstrProfRecord &Record) = 0;
   /// Iterator over profile data.
   InstrProfIterator begin() { return InstrProfIterator(this); }
   InstrProfIterator end() { return InstrProfIterator(); }
 
 protected:
-  /// Set the current error_code and return same.
-  error_code error(error_code EC) {
+  /// Set the current std::error_code and return same.
+  std::error_code error(std::error_code EC) {
     LastError = EC;
     return EC;
   }
 
   /// Clear the current error code and return a successful one.
-  error_code success() { return error(instrprof_error::success); }
+  std::error_code success() { return error(instrprof_error::success); }
 
 public:
   /// Return true if the reader has finished reading the profile data.
@@ -89,12 +90,12 @@ public:
   /// Return true if the reader encountered an error reading profiling data.
   bool hasError() { return LastError && !isEOF(); }
   /// Get the current error code.
-  error_code getError() { return LastError; }
+  std::error_code getError() { return LastError; }
 
   /// Factory method to create an appropriately typed reader for the given
   /// instrprof file.
-  static error_code create(std::string Path,
-                           std::unique_ptr<InstrProfReader> &Result);
+  static std::error_code create(std::string Path,
+                                std::unique_ptr<InstrProfReader> &Result);
 };
 
 /// Reader for the simple text based instrprof format.
@@ -122,9 +123,9 @@ public:
       : DataBuffer(std::move(DataBuffer_)), Line(*DataBuffer, '#') {}
 
   /// Read the header.
-  error_code readHeader() override { return success(); }
+  std::error_code readHeader() override { return success(); }
   /// Read a single record.
-  error_code readNextRecord(InstrProfRecord &Record) override;
+  std::error_code readNextRecord(InstrProfRecord &Record) override;
 };
 
 /// Reader for the raw instrprof binary format from runtime.
@@ -175,12 +176,12 @@ public:
       : DataBuffer(std::move(DataBuffer)) { }
 
   static bool hasFormat(const MemoryBuffer &DataBuffer);
-  error_code readHeader() override;
-  error_code readNextRecord(InstrProfRecord &Record) override;
+  std::error_code readHeader() override;
+  std::error_code readNextRecord(InstrProfRecord &Record) override;
 
 private:
-  error_code readNextHeader(const char *CurrentPos);
-  error_code readHeader(const RawHeader &Header);
+  std::error_code readNextHeader(const char *CurrentPos);
+  std::error_code readHeader(const RawHeader &Header);
   template <class IntT>
   IntT swap(IntT Int) const {
     return ShouldSwapBytes ? sys::SwapByteOrder(Int) : Int;
@@ -281,19 +282,19 @@ public:
   static bool hasFormat(const MemoryBuffer &DataBuffer);
 
   /// Read the file header.
-  error_code readHeader() override;
+  std::error_code readHeader() override;
   /// Read a single record.
-  error_code readNextRecord(InstrProfRecord &Record) override;
+  std::error_code readNextRecord(InstrProfRecord &Record) override;
 
   /// Fill Counts with the profile data for the given function name.
-  error_code getFunctionCounts(StringRef FuncName, uint64_t &FuncHash,
-                               std::vector<uint64_t> &Counts);
+  std::error_code getFunctionCounts(StringRef FuncName, uint64_t &FuncHash,
+                                    std::vector<uint64_t> &Counts);
   /// Return the maximum of all known function counts.
   uint64_t getMaximumFunctionCount() { return MaxFunctionCount; }
 
   /// Factory method to create an indexed reader.
-  static error_code create(std::string Path,
-                           std::unique_ptr<IndexedInstrProfReader> &Result);
+  static std::error_code
+  create(std::string Path, std::unique_ptr<IndexedInstrProfReader> &Result);
 };
 
 } // end namespace llvm
index fa37bf116d7dc7acec0c551653674acbec0770c7..6e68bee30eb8ad15f39efa0a15dfa924db9d3fc8 100644 (file)
@@ -38,8 +38,9 @@ public:
   /// Add function counts for the given function. If there are already counts
   /// for this function and the hash and number of counts match, each counter is
   /// summed.
-  error_code addFunctionCounts(StringRef FunctionName, uint64_t FunctionHash,
-                               ArrayRef<uint64_t> Counters);
+  std::error_code addFunctionCounts(StringRef FunctionName,
+                                    uint64_t FunctionHash,
+                                    ArrayRef<uint64_t> Counters);
   /// Ensure that all data is written to disk.
   void write(raw_fd_ostream &OS);
 };
index 8664ced657a165fcd0ea2def57dc04f5ffbb655f..fc111109fcd2b1593a3a494146bf76d47250ce72 100644 (file)
@@ -23,7 +23,6 @@
 #include <type_traits>
 
 namespace llvm {
-using std::error_code;
 template<class T, class V>
 typename std::enable_if< std::is_constructible<T, V>::value
                        , typename std::remove_reference<V>::type>::type &&
@@ -101,11 +100,11 @@ public:
                                   void *>::type = 0)
       : HasError(true) {
     using std::make_error_code;
-    new (getErrorStorage()) error_code(make_error_code(ErrorCode));
+    new (getErrorStorage()) std::error_code(make_error_code(ErrorCode));
   }
 
   ErrorOr(std::error_code EC) : HasError(true) {
-    new (getErrorStorage()) error_code(EC);
+    new (getErrorStorage()) std::error_code(EC);
   }
 
   ErrorOr(T Val) : HasError(false) {
@@ -165,8 +164,8 @@ public:
   reference get() { return *getStorage(); }
   const_reference get() const { return const_cast<ErrorOr<T> >(this)->get(); }
 
-  error_code getError() const {
-    return HasError ? *getErrorStorage() : error_code();
+  std::error_code getError() const {
+    return HasError ? *getErrorStorage() : std::error_code();
   }
 
   pointer operator ->() {
@@ -187,7 +186,7 @@ private:
     } else {
       // Get other's error.
       HasError = true;
-      new (getErrorStorage()) error_code(Other.getError());
+      new (getErrorStorage()) std::error_code(Other.getError());
     }
   }
 
@@ -219,7 +218,7 @@ private:
     } else {
       // Get other's error.
       HasError = true;
-      new (getErrorStorage()) error_code(Other.getError());
+      new (getErrorStorage()) std::error_code(Other.getError());
     }
   }
 
@@ -250,19 +249,19 @@ private:
     return reinterpret_cast<const storage_type*>(TStorage.buffer);
   }
 
-  error_code *getErrorStorage() {
+  std::error_code *getErrorStorage() {
     assert(HasError && "Cannot get error when a value exists!");
-    return reinterpret_cast<error_code*>(ErrorStorage.buffer);
+    return reinterpret_cast<std::error_code *>(ErrorStorage.buffer);
   }
 
-  const error_code *getErrorStorage() const {
+  const std::error_code *getErrorStorage() const {
     return const_cast<ErrorOr<T> *>(this)->getErrorStorage();
   }
 
 
   union {
     AlignedCharArrayUnion<storage_type> TStorage;
-    AlignedCharArrayUnion<error_code> ErrorStorage;
+    AlignedCharArrayUnion<std::error_code> ErrorStorage;
   };
   bool HasError : 1;
 };
@@ -272,7 +271,7 @@ typename std::enable_if<std::is_error_code_enum<E>::value ||
                             std::is_error_condition_enum<E>::value,
                         bool>::type
 operator==(ErrorOr<T> &Err, E Code) {
-  return error_code(Err) == Code;
+  return std::error_code(Err) == Code;
 }
 } // end namespace llvm
 
index 40a883ab3b4b7ecaa49238572c6e6dd02b8571a2..0a9a979951563c32f48be2c7423c3e5f85657539 100644 (file)
@@ -37,9 +37,9 @@ public:
   /// Factory method to create an OutputBuffer object which manages a read/write
   /// buffer of the specified size. When committed, the buffer will be written
   /// to the file at the specified path.
-  static error_code create(StringRef FilePath, size_t Size,
-                           std::unique_ptr<FileOutputBuffer> &Result,
-                           unsigned Flags = 0);
+  static std::error_code create(StringRef FilePath, size_t Size,
+                                std::unique_ptr<FileOutputBuffer> &Result,
+                                unsigned Flags = 0);
 
   /// Returns a pointer to the start of the buffer.
   uint8_t *getBufferStart() {
@@ -66,7 +66,7 @@ public:
   /// is called, the file is deleted in the destructor. The optional parameter
   /// is used if it turns out you want the file size to be smaller than
   /// initially requested.
-  error_code commit(int64_t NewSmallerSize = -1);
+  std::error_code commit(int64_t NewSmallerSize = -1);
 
   /// If this object was previously committed, the destructor just deletes
   /// this object.  If this object was not committed, the destructor
index 678a3c19ca606e3d4a4ec91bbed53ea10ceddd1a..6abe90446b47963d702a9ac2fa7aaecf4fe9e1f9 100644 (file)
@@ -46,7 +46,6 @@
 #endif
 
 namespace llvm {
-using std::error_code;
 namespace sys {
 namespace fs {
 
@@ -275,7 +274,7 @@ private:
 /// @param path A path that is modified to be an absolute path.
 /// @returns errc::success if \a path has been made absolute, otherwise a
 ///          platform specific error_code.
-error_code make_absolute(SmallVectorImpl<char> &path);
+std::error_code make_absolute(SmallVectorImpl<char> &path);
 
 /// @brief Normalize path separators in \a Path
 ///
@@ -283,7 +282,7 @@ error_code make_absolute(SmallVectorImpl<char> &path);
 /// This is particularly useful when cross-compiling Windows on Linux, but is
 /// safe to invoke on Windows, which accepts both characters as a path
 /// separator.
-error_code normalize_separators(SmallVectorImpl<char> &Path);
+std::error_code normalize_separators(SmallVectorImpl<char> &Path);
 
 /// @brief Create all the non-existent directories in path.
 ///
@@ -291,7 +290,8 @@ error_code normalize_separators(SmallVectorImpl<char> &Path);
 /// @returns errc::success if is_directory(path), otherwise a platform
 ///          specific error_code. If IgnoreExisting is false, also returns
 ///          error if the directory already existed.
-error_code create_directories(const Twine &path, bool IgnoreExisting = true);
+std::error_code create_directories(const Twine &path,
+                                   bool IgnoreExisting = true);
 
 /// @brief Create the directory in path.
 ///
@@ -299,7 +299,7 @@ error_code create_directories(const Twine &path, bool IgnoreExisting = true);
 /// @returns errc::success if is_directory(path), otherwise a platform
 ///          specific error_code. If IgnoreExisting is false, also returns
 ///          error if the directory already existed.
-error_code create_directory(const Twine &path, bool IgnoreExisting = true);
+std::error_code create_directory(const Twine &path, bool IgnoreExisting = true);
 
 /// @brief Create a link from \a from to \a to.
 ///
@@ -312,14 +312,14 @@ error_code create_directory(const Twine &path, bool IgnoreExisting = true);
 /// @param from The path to hard link from. This is created.
 /// @returns errc::success if the link was created, otherwise a platform
 /// specific error_code.
-error_code create_link(const Twine &to, const Twine &from);
+std::error_code create_link(const Twine &to, const Twine &from);
 
 /// @brief Get the current path.
 ///
 /// @param result Holds the current path on return.
 /// @returns errc::success if the current path has been stored in result,
 ///          otherwise a platform specific error_code.
-error_code current_path(SmallVectorImpl<char> &result);
+std::error_code current_path(SmallVectorImpl<char> &result);
 
 /// @brief Remove path. Equivalent to POSIX remove().
 ///
@@ -327,13 +327,13 @@ error_code current_path(SmallVectorImpl<char> &result);
 /// @returns errc::success if path has been removed or didn't exist, otherwise a
 ///          platform specific error code. If IgnoreNonExisting is false, also
 ///          returns error if the file didn't exist.
-error_code remove(const Twine &path, bool IgnoreNonExisting = true);
+std::error_code remove(const Twine &path, bool IgnoreNonExisting = true);
 
 /// @brief Rename \a from to \a to. Files are renamed as if by POSIX rename().
 ///
 /// @param from The path to rename from.
 /// @param to The path to rename to. This is created.
-error_code rename(const Twine &from, const Twine &to);
+std::error_code rename(const Twine &from, const Twine &to);
 
 /// @brief Resize path to size. File is resized as if by POSIX truncate().
 ///
@@ -341,7 +341,7 @@ error_code rename(const Twine &from, const Twine &to);
 /// @param size Size to resize to.
 /// @returns errc::success if \a path has been resized to \a size, otherwise a
 ///          platform specific error_code.
-error_code resize_file(const Twine &path, uint64_t size);
+std::error_code resize_file(const Twine &path, uint64_t size);
 
 /// @}
 /// @name Physical Observers
@@ -361,7 +361,7 @@ bool exists(file_status status);
 ///               it does not. Undefined otherwise.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform specific error_code.
-error_code exists(const Twine &path, bool &result);
+std::error_code exists(const Twine &path, bool &result);
 
 /// @brief Simpler version of exists for clients that don't need to
 ///        differentiate between an error and false.
@@ -403,7 +403,7 @@ bool equivalent(file_status A, file_status B);
 ///               inode (or equivalent).
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform specific error_code.
-error_code equivalent(const Twine &A, const Twine &B, bool &result);
+std::error_code equivalent(const Twine &A, const Twine &B, bool &result);
 
 /// @brief Simpler version of equivalent for clients that don't need to
 ///        differentiate between an error and false.
@@ -425,7 +425,7 @@ bool is_directory(file_status status);
 ///               Undefined otherwise.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform specific error_code.
-error_code is_directory(const Twine &path, bool &result);
+std::error_code is_directory(const Twine &path, bool &result);
 
 /// @brief Simpler version of is_directory for clients that don't need to
 ///        differentiate between an error and false.
@@ -447,7 +447,7 @@ bool is_regular_file(file_status status);
 ///               Undefined otherwise.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform specific error_code.
-error_code is_regular_file(const Twine &path, bool &result);
+std::error_code is_regular_file(const Twine &path, bool &result);
 
 /// @brief Simpler version of is_regular_file for clients that don't need to
 ///        differentiate between an error and false.
@@ -473,7 +473,7 @@ bool is_other(file_status status);
 ///               file, or a symlink, false if it does not. Undefined otherwise.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform specific error_code.
-error_code is_other(const Twine &path, bool &result);
+std::error_code is_other(const Twine &path, bool &result);
 
 /// @brief Get file status as if by POSIX stat().
 ///
@@ -481,10 +481,10 @@ error_code is_other(const Twine &path, bool &result);
 /// @param result Set to the file status.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform specific error_code.
-error_code status(const Twine &path, file_status &result);
+std::error_code status(const Twine &path, file_status &result);
 
 /// @brief A version for when a file descriptor is already available.
-error_code status(int FD, file_status &Result);
+std::error_code status(int FD, file_status &Result);
 
 /// @brief Get file size.
 ///
@@ -492,13 +492,13 @@ error_code status(int FD, file_status &Result);
 /// @param Result Set to the size of the file in \a Path.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform specific error_code.
-inline error_code file_size(const Twine &Path, uint64_t &Result) {
+inline std::error_code file_size(const Twine &Path, uint64_t &Result) {
   file_status Status;
-  error_code EC = status(Path, Status);
+  std::error_code EC = status(Path, Status);
   if (EC)
     return EC;
   Result = Status.getSize();
-  return error_code();
+  return std::error_code();
 }
 
 /// @brief Set the file modification and access time.
@@ -506,7 +506,7 @@ inline error_code file_size(const Twine &Path, uint64_t &Result) {
 /// @returns errc::success if the file times were successfully set, otherwise a
 ///          platform specific error_code or errc::not_supported on platforms
 ///          where the functionality isn't available.
-error_code setLastModificationAndAccessTime(int FD, TimeValue Time);
+std::error_code setLastModificationAndAccessTime(int FD, TimeValue Time);
 
 /// @brief Is status available?
 ///
@@ -520,7 +520,7 @@ bool status_known(file_status s);
 /// @param result Set to true if status() != status_error.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform specific error_code.
-error_code status_known(const Twine &path, bool &result);
+std::error_code status_known(const Twine &path, bool &result);
 
 /// @brief Create a uniquely named file.
 ///
@@ -543,13 +543,13 @@ error_code status_known(const Twine &path, bool &result);
 /// @param ResultPath Set to the opened file's absolute path.
 /// @returns errc::success if Result{FD,Path} have been successfully set,
 ///          otherwise a platform specific error_code.
-error_code createUniqueFile(const Twine &Model, int &ResultFD,
-                            SmallVectorImpl<char> &ResultPath,
-                            unsigned Mode = all_read | all_write);
+std::error_code createUniqueFile(const Twine &Model, int &ResultFD,
+                                 SmallVectorImpl<char> &ResultPath,
+                                 unsigned Mode = all_read | all_write);
 
 /// @brief Simpler version for clients that don't want an open file.
-error_code createUniqueFile(const Twine &Model,
-                            SmallVectorImpl<char> &ResultPath);
+std::error_code createUniqueFile(const Twine &Model,
+                                 SmallVectorImpl<char> &ResultPath);
 
 /// @brief Create a file in the system temporary directory.
 ///
@@ -559,16 +559,16 @@ error_code createUniqueFile(const Twine &Model,
 ///
 /// This should be used for things like a temporary .s that is removed after
 /// running the assembler.
-error_code createTemporaryFile(const Twine &Prefix, StringRef Suffix,
-                               int &ResultFD,
-                               SmallVectorImpl<char> &ResultPath);
+std::error_code createTemporaryFile(const Twine &Prefix, StringRef Suffix,
+                                    int &ResultFD,
+                                    SmallVectorImpl<char> &ResultPath);
 
 /// @brief Simpler version for clients that don't want an open file.
-error_code createTemporaryFile(const Twine &Prefix, StringRef Suffix,
-                               SmallVectorImpl<char> &ResultPath);
+std::error_code createTemporaryFile(const Twine &Prefix, StringRef Suffix,
+                                    SmallVectorImpl<char> &ResultPath);
 
-error_code createUniqueDirectory(const Twine &Prefix,
-                                 SmallVectorImpl<char> &ResultPath);
+std::error_code createUniqueDirectory(const Twine &Prefix,
+                                      SmallVectorImpl<char> &ResultPath);
 
 enum OpenFlags : unsigned {
   F_None = 0,
@@ -599,10 +599,10 @@ inline OpenFlags &operator|=(OpenFlags &A, OpenFlags B) {
   return A;
 }
 
-error_code openFileForWrite(const Twine &Name, int &ResultFD, OpenFlags Flags,
-                            unsigned Mode = 0666);
+std::error_code openFileForWrite(const Twine &Name, int &ResultFD,
+                                 OpenFlags Flags, unsigned Mode = 0666);
 
-error_code openFileForRead(const Twine &Name, int &ResultFD);
+std::error_code openFileForRead(const Twine &Name, int &ResultFD);
 
 /// @brief Identify the type of a binary file based on how magical it is.
 file_magic identify_magic(StringRef magic);
@@ -613,9 +613,9 @@ file_magic identify_magic(StringRef magic);
 /// @param result Set to the type of file, or file_magic::unknown.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform specific error_code.
-error_code identify_magic(const Twine &path, file_magic &result);
+std::error_code identify_magic(const Twine &path, file_magic &result);
 
-error_code getUniqueID(const Twine Path, UniqueID &Result);
+std::error_code getUniqueID(const Twine Path, UniqueID &Result);
 
 /// This class represents a memory mapped file. It is based on
 /// boost::iostreams::mapped_file.
@@ -642,7 +642,7 @@ private:
   void *FileMappingHandle;
 #endif
 
-  error_code init(int FD, bool CloseFD, uint64_t Offset);
+  std::error_code init(int FD, bool CloseFD, uint64_t Offset);
 
 public:
   typedef char char_type;
@@ -664,21 +664,14 @@ public:
   ///               mapped_file_region::alignment().
   /// \param ec This is set to errc::success if the map was constructed
   ///           successfully. Otherwise it is set to a platform dependent error.
-  mapped_file_region(const Twine &path,
-                     mapmode mode,
-                     uint64_t length,
-                     uint64_t offset,
-                     error_code &ec);
+  mapped_file_region(const Twine &path, mapmode mode, uint64_t length,
+                     uint64_t offset, std::error_code &ec);
 
   /// \param fd An open file descriptor to map. mapped_file_region takes
   ///   ownership if closefd is true. It must have been opended in the correct
   ///   mode.
-  mapped_file_region(int fd,
-                     bool closefd,
-                     mapmode mode,
-                     uint64_t length,
-                     uint64_t offset,
-                     error_code &ec);
+  mapped_file_region(int fd, bool closefd, mapmode mode, uint64_t length,
+                     uint64_t offset, std::error_code &ec);
 
   ~mapped_file_region();
 
@@ -725,7 +718,7 @@ public:
   void replace_filename(const Twine &filename, file_status st = file_status());
 
   const std::string &path() const { return Path; }
-  error_code status(file_status &result) const;
+  std::error_code status(file_status &result) const;
 
   bool operator==(const directory_entry& rhs) const { return Path == rhs.Path; }
   bool operator!=(const directory_entry& rhs) const { return !(*this == rhs); }
@@ -738,9 +731,9 @@ public:
 namespace detail {
   struct DirIterState;
 
-  error_code directory_iterator_construct(DirIterState&, StringRef);
-  error_code directory_iterator_increment(DirIterState&);
-  error_code directory_iterator_destruct(DirIterState&);
+  std::error_code directory_iterator_construct(DirIterState &, StringRef);
+  std::error_code directory_iterator_increment(DirIterState &);
+  std::error_code directory_iterator_destruct(DirIterState &);
 
   /// DirIterState - Keeps state for the directory_iterator. It is reference
   /// counted in order to preserve InputIterator semantics on copy.
@@ -764,14 +757,14 @@ class directory_iterator {
   IntrusiveRefCntPtr<detail::DirIterState> State;
 
 public:
-  explicit directory_iterator(const Twine &path, error_code &ec) {
+  explicit directory_iterator(const Twine &path, std::error_code &ec) {
     State = new detail::DirIterState;
     SmallString<128> path_storage;
     ec = detail::directory_iterator_construct(*State,
             path.toStringRef(path_storage));
   }
 
-  explicit directory_iterator(const directory_entry &de, error_code &ec) {
+  explicit directory_iterator(const directory_entry &de, std::error_code &ec) {
     State = new detail::DirIterState;
     ec = detail::directory_iterator_construct(*State, de.path());
   }
@@ -780,7 +773,7 @@ public:
   directory_iterator() : State(nullptr) {}
 
   // No operator++ because we need error_code.
-  directory_iterator &increment(error_code &ec) {
+  directory_iterator &increment(std::error_code &ec) {
     ec = directory_iterator_increment(*State);
     return *this;
   }
@@ -826,14 +819,14 @@ class recursive_directory_iterator {
 
 public:
   recursive_directory_iterator() {}
-  explicit recursive_directory_iterator(const Twine &path, error_code &ec)
-    : State(new detail::RecDirIterState) {
+  explicit recursive_directory_iterator(const Twine &path, std::error_code &ec)
+      : State(new detail::RecDirIterState) {
     State->Stack.push(directory_iterator(path, ec));
     if (State->Stack.top() == directory_iterator())
       State.reset();
   }
   // No operator++ because we need error_code.
-  recursive_directory_iterator &increment(error_code &ec) {
+  recursive_directory_iterator &increment(std::error_code &ec) {
     const directory_iterator end_itr;
 
     if (State->HasNoPushRequest)
@@ -882,7 +875,7 @@ public:
     assert(State->Level > 0 && "Cannot pop an iterator with level < 1");
 
     const directory_iterator end_itr;
-    error_code ec;
+    std::error_code ec;
     do {
       if (ec)
         report_fatal_error("Error incrementing directory iterator.");
index dca28fa878f474232d6b78fdf803e57e2d2e55df..61c65dabae3c9d785d59f201e55f7441c5ed116e 100644 (file)
@@ -16,7 +16,6 @@
 #include <utility> // for std::pair
 
 namespace llvm {
-using std::error_code;
 /// \brief Class that manages the creation of a lock file to aid
 /// implicit coordination between different processes.
 ///
@@ -56,7 +55,7 @@ private:
   SmallString<128> UniqueLockFileName;
 
   Optional<std::pair<std::string, int> > Owner;
-  Optional<error_code> Error;
+  Optional<std::error_code> Error;
 
   LockFileManager(const LockFileManager &) LLVM_DELETED_FUNCTION;
   LockFileManager &operator=(const LockFileManager &) LLVM_DELETED_FUNCTION;
index acd7a04080016096fd39463b6c2355106c644a9c..b4305cb697d0c720d254f3c17badb8938895add1 100644 (file)
@@ -19,7 +19,6 @@
 #include <system_error>
 
 namespace llvm {
-using std::error_code;
 namespace sys {
 
   /// This class encapsulates the notion of a memory block which has an address
@@ -78,7 +77,7 @@ namespace sys {
     static MemoryBlock allocateMappedMemory(size_t NumBytes,
                                             const MemoryBlock *const NearBlock,
                                             unsigned Flags,
-                                            error_code &EC);
+                                            std::error_code &EC);
 
     /// This method releases a block of memory that was allocated with the
     /// allocateMappedMemory method. It should not be used to release any
@@ -89,7 +88,7 @@ namespace sys {
     /// describing the failure if an error occurred.
     /// 
     /// @brief Release mapped memory.
-    static error_code releaseMappedMemory(MemoryBlock &Block);
+    static std::error_code releaseMappedMemory(MemoryBlock &Block);
 
     /// This method sets the protection flags for a block of memory to the
     /// state specified by /p Flags.  The behavior is not specified if the
@@ -106,8 +105,8 @@ namespace sys {
     /// describing the failure if an error occurred.
     ///
     /// @brief Set memory protection state.
-    static error_code protectMappedMemory(const MemoryBlock &Block,
-                                          unsigned Flags);
+    static std::error_code protectMappedMemory(const MemoryBlock &Block,
+                                               unsigned Flags);
 
     /// This method allocates a block of Read/Write/Execute memory that is
     /// suitable for executing dynamically generated code (e.g. JIT). An
index 6d6a5da180b70ce3ce63d4fef6c100191c165c9b..8c742c686b15cd561ac1dbf86b29ac6584b64081 100644 (file)
@@ -23,7 +23,6 @@
 #include <system_error>
 
 namespace llvm {
-using std::error_code;
 /// MemoryBuffer - This interface provides simple read-only access to a block
 /// of memory, and provides simple methods for reading files and standard input
 /// into a memory buffer.  In addition to basic access to the characters in the
@@ -69,11 +68,11 @@ public:
   /// \param IsVolatileSize Set to true to indicate that the file size may be
   /// changing, e.g. when libclang tries to parse while the user is
   /// editing/updating the file.
-  static error_code getFile(Twine Filename,
-                            std::unique_ptr<MemoryBuffer> &Result,
-                            int64_t FileSize = -1,
-                            bool RequiresNullTerminator = true,
-                            bool IsVolatileSize = false);
+  static std::error_code getFile(Twine Filename,
+                                 std::unique_ptr<MemoryBuffer> &Result,
+                                 int64_t FileSize = -1,
+                                 bool RequiresNullTerminator = true,
+                                 bool IsVolatileSize = false);
 
   /// Given an already-open file descriptor, map some slice of it into a
   /// MemoryBuffer. The slice is specified by an \p Offset and \p MapSize.
@@ -82,10 +81,10 @@ public:
   /// \param IsVolatileSize Set to true to indicate that the file size may be
   /// changing, e.g. when libclang tries to parse while the user is
   /// editing/updating the file.
-  static error_code getOpenFileSlice(int FD, const char *Filename,
-                                     std::unique_ptr<MemoryBuffer> &Result,
-                                     uint64_t MapSize, int64_t Offset,
-                                     bool IsVolatileSize = false);
+  static std::error_code getOpenFileSlice(int FD, const char *Filename,
+                                          std::unique_ptr<MemoryBuffer> &Result,
+                                          uint64_t MapSize, int64_t Offset,
+                                          bool IsVolatileSize = false);
 
   /// Given an already-open file descriptor, read the file and return a
   /// MemoryBuffer.
@@ -93,11 +92,11 @@ public:
   /// \param IsVolatileSize Set to true to indicate that the file size may be
   /// changing, e.g. when libclang tries to parse while the user is
   /// editing/updating the file.
-  static error_code getOpenFile(int FD, const char *Filename,
-                                std::unique_ptr<MemoryBuffer> &Result,
-                                uint64_t FileSize,
-                                bool RequiresNullTerminator = true,
-                                bool IsVolatileSize = false);
+  static std::error_code getOpenFile(int FD, const char *Filename,
+                                     std::unique_ptr<MemoryBuffer> &Result,
+                                     uint64_t FileSize,
+                                     bool RequiresNullTerminator = true,
+                                     bool IsVolatileSize = false);
 
   /// getMemBuffer - Open the specified memory range as a MemoryBuffer.  Note
   /// that InputData must be null terminated if RequiresNullTerminator is true.
@@ -126,15 +125,14 @@ public:
 
   /// getSTDIN - Read all of stdin into a file buffer, and return it.
   /// If an error occurs, this returns null and sets ec.
-  static error_code getSTDIN(std::unique_ptr<MemoryBuffer> &Result);
-
+  static std::error_code getSTDIN(std::unique_ptr<MemoryBuffer> &Result);
 
   /// getFileOrSTDIN - Open the specified file as a MemoryBuffer, or open stdin
   /// if the Filename is "-".  If an error occurs, this returns null and sets
   /// ec.
-  static error_code getFileOrSTDIN(StringRef Filename,
-                                   std::unique_ptr<MemoryBuffer> &Result,
-                                   int64_t FileSize = -1);
+  static std::error_code getFileOrSTDIN(StringRef Filename,
+                                        std::unique_ptr<MemoryBuffer> &Result,
+                                        int64_t FileSize = -1);
 
   //===--------------------------------------------------------------------===//
   // Provided for performance analysis.
index 3ca3372afd743f9e0b8c8c05981899adfe337ffc..4f98e4de812513a44a7e9237560d1f114af9e1ff 100644 (file)
@@ -174,7 +174,7 @@ public:
   /// This function returns a SmallVector containing the arguments passed from
   /// the operating system to the program.  This function expects to be handed
   /// the vector passed in from main.
-  static error_code
+  static std::error_code
   GetArgumentVector(SmallVectorImpl<const char *> &Args,
                     ArrayRef<const char *> ArgsFromMain,
                     SpecificBumpPtrAllocator<char> &ArgAllocator);
index c1269508e04c16b2bb1e69bdbefcc2ca819ac424..51279a9b864ae6b91059b94d98dd8d3d4168198b 100644 (file)
@@ -19,7 +19,6 @@
 #include <system_error>
 
 namespace llvm {
-using std::error_code;
 namespace sys {
 
   /// This is the OS-specific separator for PATH like environment variables:
@@ -67,8 +66,8 @@ struct ProcessInfo {
   // These functions change the specified standard stream (stdin or stdout) to
   // binary mode. They return errc::success if the specified stream
   // was changed. Otherwise a platform dependent error is returned.
-  error_code ChangeStdinToBinary();
-  error_code ChangeStdoutToBinary();
+  std::error_code ChangeStdinToBinary();
+  std::error_code ChangeStdoutToBinary();
 
   /// This function executes the program using the arguments provided.  The
   /// invoked program will inherit the stdin, stdout, and stderr file
index ef9328a0b1c34297b02d9809b2fcaa51524dc22b..1dfcc191cb06fea40b5f4c86bd576dd0e7cb8f7b 100644 (file)
@@ -20,6 +20,7 @@
 #include <cstring>
 #include <system_error>
 using namespace llvm;
+using std::error_code;
 
 Module *llvm::ParseAssembly(MemoryBuffer *F,
                             Module *M,
index 716299fc68e3171c4926863e278d3c5230d218a4..2610e7f96e653d2347f72415c887bac120499071 100644 (file)
@@ -16,6 +16,7 @@
 #include <string>
 
 using namespace llvm;
+using std::error_code;
 
 /* Builds a module from the bitcode in the specified memory buffer, returning a
    reference to the module via the OutModule parameter. Returns 0 on success.
index 485bd1c12ab43d8f10696f478f3ed46cf25565f8..7a1b3f2d037a744b5af235f311a293ba8602290c 100644 (file)
@@ -26,6 +26,7 @@
 #include <vector>
 
 namespace llvm {
+using std::error_code;
   class MemoryBuffer;
   class LLVMContext;
 
index e52e8afab84d7cf4034876366d67c2495da5f881..110fd815da29e0060fe60c82e065de7393ca40d4 100644 (file)
@@ -21,6 +21,7 @@
 using namespace llvm;
 using namespace dwarf;
 using namespace object;
+using std::error_code;
 
 #define DEBUG_TYPE "dwarf"
 
index c589457b670dc495d7c822798f3f623b30d4bd3e..e3e63f4d5f9cd3adfe0fee1fefb7eb3810c1eb38 100644 (file)
@@ -19,6 +19,7 @@
 #include "llvm/IR/Module.h"
 #include <cstring>
 using namespace llvm;
+using std::error_code;
 
 namespace {
 
index 1b7d386adc760057f2e5d8933d0976a71374d76d..59860844e93902092a8b5363420d4569139e6355 100644 (file)
@@ -71,7 +71,7 @@ uint8_t *SectionMemoryManager::allocateSection(MemoryGroup &MemGroup,
   //
   // FIXME: Initialize the Near member for each memory group to avoid
   // interleaving.
-  error_code ec;
+  std::error_code ec;
   sys::MemoryBlock MB = sys::Memory::allocateMappedMemory(RequiredSize,
                                                           &MemGroup.Near,
                                                           sys::Memory::MF_READ |
@@ -105,7 +105,7 @@ uint8_t *SectionMemoryManager::allocateSection(MemoryGroup &MemGroup,
 bool SectionMemoryManager::finalizeMemory(std::string *ErrMsg)
 {
   // FIXME: Should in-progress permissions be reverted if an error occurs?
-  error_code ec;
+  std::error_code ec;
 
   // Don't allow free memory blocks to be used after setting protection flags.
   CodeMem.FreeMem.clear();
@@ -143,19 +143,20 @@ bool SectionMemoryManager::finalizeMemory(std::string *ErrMsg)
   return false;
 }
 
-error_code SectionMemoryManager::applyMemoryGroupPermissions(MemoryGroup &MemGroup,
-                                                             unsigned Permissions) {
+std::error_code
+SectionMemoryManager::applyMemoryGroupPermissions(MemoryGroup &MemGroup,
+                                                  unsigned Permissions) {
 
   for (int i = 0, e = MemGroup.AllocatedMem.size(); i != e; ++i) {
-      error_code ec;
-      ec = sys::Memory::protectMappedMemory(MemGroup.AllocatedMem[i],
-                                            Permissions);
-      if (ec) {
-        return ec;
-      }
+    std::error_code ec;
+    ec =
+        sys::Memory::protectMappedMemory(MemGroup.AllocatedMem[i], Permissions);
+    if (ec) {
+      return ec;
+    }
   }
 
-  return error_code();
+  return std::error_code();
 }
 
 void SectionMemoryManager::invalidateInstructionCache() {
index a526073bc04632aaffa4a704cb604ba18799e87e..53cf8f99ffb9af9f46a48dea0b0a9f52d0c45b5d 100644 (file)
@@ -20,6 +20,7 @@
 using namespace llvm;
 
 namespace llvm {
+using std::error_code;
 
 namespace {
 // Helper for extensive error checking in debug builds.
index db3128cfa07874f571e57d17375b77e9795b48f7..5dfe9a68a2734f017244c38405db96dd41f50686 100644 (file)
@@ -41,6 +41,7 @@
 #include <system_error>
 
 using namespace llvm;
+using std::error_code;
 
 #define DEBUG_TYPE "ir"
 
index 77dd7e881bd2b481092ac15914d7aa551601b06c..c8dc951a9bf7e7f63abdf4f786bd14ea973dd24b 100644 (file)
@@ -22,6 +22,7 @@
 #include <algorithm>
 #include <system_error>
 using namespace llvm;
+using std::error_code;
 
 //===----------------------------------------------------------------------===//
 // GCOVFile implementation.
index 91b2d91c62b4ddb60c8362ef1ab9c6e4846c4053..bc72a67917b8b538eb40e450f4eff7c115ac752a 100644 (file)
@@ -28,6 +28,7 @@
 #include <cstdarg>
 #include <cstdlib>
 using namespace llvm;
+using std::error_code;
 
 //===----------------------------------------------------------------------===//
 // Methods to implement the globals and functions lists.
index 3e928d464245e212e862bed19f3ff14100caa91a..e170a3c85ac87c948eef0832f5752f5bc2b18ada 100644 (file)
@@ -21,6 +21,7 @@
 #include <system_error>
 
 using namespace llvm;
+using std::error_code;
 
 namespace llvm {
   extern bool TimePassesIsEnabled;
index 7c62e48bf5ff8aa50fc07f509924dd4c70de26bf..c263f8f477bf2a2b165a4464976a1041775e6f3c 100644 (file)
@@ -53,6 +53,7 @@
 #include "llvm/Transforms/ObjCARC.h"
 #include <system_error>
 using namespace llvm;
+using std::error_code;
 
 const char* LTOCodeGenerator::getVersionString() {
 #ifdef LLVM_VERSION_INFO
index 9af79e5d854a3f4827c77647bded62f6b904d9f5..aee0ef8cdcbe4d039f3d9be1adf9bbc32f3c3b88 100644 (file)
@@ -43,6 +43,7 @@
 #include "llvm/Transforms/Utils/GlobalStatus.h"
 #include <system_error>
 using namespace llvm;
+using std::error_code;
 
 LTOModule::LTOModule(llvm::Module *m, llvm::TargetMachine *t)
   : _module(m), _target(t),
index 130bb99f98bb324dde2e9fd9ac5733af215d88aa..4ec621fea0c96b10f9d504723154b5c724d6a380 100644 (file)
@@ -28,6 +28,7 @@
 #include <map>
 
 using namespace llvm;
+using std::error_code;
 
 MCContext::MCContext(const MCAsmInfo *mai, const MCRegisterInfo *mri,
                      const MCObjectFileInfo *mofi, const SourceMgr *mgr,
index f81cb149d83a9ab903935a8c84e356d066c66c6c..0df6afd9f02a255b3748ef1e4a8370c81c3ad043 100644 (file)
@@ -25,6 +25,7 @@
 #include <vector>
 
 namespace llvm {
+using std::error_code;
 
 namespace {
 
index 77421c7da3c0d04a8913e6fa13ae4bada79026b7..1e66da06392dcf6d3d7cd204820358390b6dc0df 100644 (file)
@@ -20,6 +20,7 @@
 
 using namespace llvm;
 using namespace object;
+using std::error_code;
 
 static const char *const Magic = "!<arch>\n";
 
index 63fd3ed0110692717518c251a7b577be9e2e6b33..c55ed0c75988b7b1a736fb06a6480851b8d68dde 100644 (file)
@@ -81,7 +81,7 @@ ErrorOr<Binary *> object::createBinary(MemoryBuffer *Source,
 
 ErrorOr<Binary *> object::createBinary(StringRef Path) {
   std::unique_ptr<MemoryBuffer> File;
-  if (error_code EC = MemoryBuffer::getFileOrSTDIN(Path, File))
+  if (std::error_code EC = MemoryBuffer::getFileOrSTDIN(Path, File))
     return EC;
   return createBinary(File.release());
 }
index 262c040c57a8558905a9933c6790e4c45c8501f6..8528840e1211b0ebf969cce8626f266af1f184b8 100644 (file)
@@ -24,6 +24,7 @@
 
 using namespace llvm;
 using namespace object;
+using std::error_code;
 
 using support::ulittle8_t;
 using support::ulittle16_t;
index a2c4df2007f7600dde8d69f5baf07877f867497b..de05abb43b902fb5c5728b0a441936e795963fd7 100644 (file)
@@ -15,6 +15,7 @@
 #include "llvm/Support/MathExtras.h"
 
 namespace llvm {
+using std::error_code;
 using namespace object;
 
 ErrorOr<ObjectFile *> ObjectFile::createELFObjectFile(MemoryBuffer *Obj,
index a8aba26c5aef81a7a224cf3aca125af7e0b91659..57c2232d47215ddd3e307feefac16460abe0fdff 100644 (file)
@@ -19,6 +19,7 @@
 #include "llvm/Support/raw_ostream.h"
 using namespace llvm;
 using namespace object;
+using std::error_code;
 
 IRObjectFile::IRObjectFile(MemoryBuffer *Object, error_code &EC,
                            LLVMContext &Context, bool BufferOwned)
index 1fb0c13407344e6d23325654f0baefe8ffb74a9f..a71a139b02cbee19a2d6ae1fee29451a2b82f7d9 100644 (file)
@@ -28,6 +28,8 @@ using namespace llvm;
 using namespace object;
 
 namespace llvm {
+using std::error_code;
+
 namespace object {
 
 struct nlist_base {
@@ -316,7 +318,7 @@ static void printRelocationTargetName(const MachOObjectFile *O,
     uint32_t Val = O->getPlainRelocationSymbolNum(RE);
 
     for (const SymbolRef &Symbol : O->symbols()) {
-      error_code ec;
+      std::error_code ec;
       uint64_t Addr;
       StringRef Name;
 
@@ -333,7 +335,7 @@ static void printRelocationTargetName(const MachOObjectFile *O,
     // If we couldn't find a symbol that this relocation refers to, try
     // to find a section beginning instead.
     for (const SectionRef &Section : O->sections()) {
-      error_code ec;
+      std::error_code ec;
       uint64_t Addr;
       StringRef Name;
 
@@ -427,7 +429,7 @@ static uint32_t getSectionFlags(const MachOObjectFile *O,
 }
 
 MachOObjectFile::MachOObjectFile(MemoryBuffer *Object, bool IsLittleEndian,
-                                 bool Is64bits, error_code &EC,
+                                 bool Is64bits, std::error_code &EC,
                                  bool BufferOwned)
     : ObjectFile(getMachOType(IsLittleEndian, Is64bits), Object, BufferOwned),
       SymtabLoadCmd(nullptr), DysymtabLoadCmd(nullptr),
@@ -475,8 +477,8 @@ void MachOObjectFile::moveSymbolNext(DataRefImpl &Symb) const {
   Symb.p += SymbolTableEntrySize;
 }
 
-error_code MachOObjectFile::getSymbolName(DataRefImpl Symb,
-                                          StringRef &Res) const {
+std::error_code MachOObjectFile::getSymbolName(DataRefImpl Symb,
+                                               StringRef &Res) const {
   StringRef StringTable = getStringTableData();
   nlist_base Entry = getSymbolTableEntryBase(this, Symb);
   const char *Start = &StringTable.data()[Entry.n_strx];
@@ -486,8 +488,8 @@ error_code MachOObjectFile::getSymbolName(DataRefImpl Symb,
 
 // getIndirectName() returns the name of the alias'ed symbol who's string table
 // index is in the n_value field.
-error_code MachOObjectFile::getIndirectName(DataRefImpl Symb,
-                                            StringRef &Res) const {
+std::error_code MachOObjectFile::getIndirectName(DataRefImpl Symb,
+                                                 StringRef &Res) const {
   StringRef StringTable = getStringTableData();
   uint64_t NValue;
   if (is64Bit()) {
@@ -508,8 +510,8 @@ error_code MachOObjectFile::getIndirectName(DataRefImpl Symb,
   return object_error::success;
 }
 
-error_code MachOObjectFile::getSymbolAddress(DataRefImpl Symb,
-                                             uint64_t &Res) const {
+std::error_code MachOObjectFile::getSymbolAddress(DataRefImpl Symb,
+                                                  uint64_t &Res) const {
   if (is64Bit()) {
     MachO::nlist_64 Entry = getSymbol64TableEntry(Symb);
     if ((Entry.n_type & MachO::N_TYPE) == MachO::N_UNDF &&
@@ -528,8 +530,8 @@ error_code MachOObjectFile::getSymbolAddress(DataRefImpl Symb,
   return object_error::success;
 }
 
-error_code MachOObjectFile::getSymbolAlignment(DataRefImpl DRI,
-                                               uint32_t &Result) const {
+std::error_code MachOObjectFile::getSymbolAlignment(DataRefImpl DRI,
+                                                    uint32_t &Result) const {
   uint32_t flags = getSymbolFlags(DRI);
   if (flags & SymbolRef::SF_Common) {
     nlist_base Entry = getSymbolTableEntryBase(this, DRI);
@@ -540,8 +542,8 @@ error_code MachOObjectFile::getSymbolAlignment(DataRefImpl DRI,
   return object_error::success;
 }
 
-error_code MachOObjectFile::getSymbolSize(DataRefImpl DRI,
-                                          uint64_t &Result) const {
+std::error_code MachOObjectFile::getSymbolSize(DataRefImpl DRI,
+                                               uint64_t &Result) const {
   uint64_t BeginOffset;
   uint64_t EndOffset = 0;
   uint8_t SectionIndex;
@@ -589,8 +591,8 @@ error_code MachOObjectFile::getSymbolSize(DataRefImpl DRI,
   return object_error::success;
 }
 
-error_code MachOObjectFile::getSymbolType(DataRefImpl Symb,
-                                          SymbolRef::Type &Res) const {
+std::error_code MachOObjectFile::getSymbolType(DataRefImpl Symb,
+                                               SymbolRef::Type &Res) const {
   nlist_base Entry = getSymbolTableEntryBase(this, Symb);
   uint8_t n_type = Entry.n_type;
 
@@ -649,9 +651,8 @@ uint32_t MachOObjectFile::getSymbolFlags(DataRefImpl DRI) const {
   return Result;
 }
 
-error_code
-MachOObjectFile::getSymbolSection(DataRefImpl Symb,
-                                  section_iterator &Res) const {
+std::error_code MachOObjectFile::getSymbolSection(DataRefImpl Symb,
+                                                  section_iterator &Res) const {
   nlist_base Entry = getSymbolTableEntryBase(this, Symb);
   uint8_t index = Entry.n_sect;
 
@@ -670,15 +671,15 @@ void MachOObjectFile::moveSectionNext(DataRefImpl &Sec) const {
   Sec.d.a++;
 }
 
-error_code
-MachOObjectFile::getSectionName(DataRefImpl Sec, StringRef &Result) const {
+std::error_code MachOObjectFile::getSectionName(DataRefImpl Sec,
+                                                StringRef &Result) const {
   ArrayRef<char> Raw = getSectionRawName(Sec);
   Result = parseSegmentOrSectionName(Raw.data());
   return object_error::success;
 }
 
-error_code
-MachOObjectFile::getSectionAddress(DataRefImpl Sec, uint64_t &Res) const {
+std::error_code MachOObjectFile::getSectionAddress(DataRefImpl Sec,
+                                                   uint64_t &Res) const {
   if (is64Bit()) {
     MachO::section_64 Sect = getSection64(Sec);
     Res = Sect.addr;
@@ -689,8 +690,8 @@ MachOObjectFile::getSectionAddress(DataRefImpl Sec, uint64_t &Res) const {
   return object_error::success;
 }
 
-error_code
-MachOObjectFile::getSectionSize(DataRefImpl Sec, uint64_t &Res) const {
+std::error_code MachOObjectFile::getSectionSize(DataRefImpl Sec,
+                                                uint64_t &Res) const {
   if (is64Bit()) {
     MachO::section_64 Sect = getSection64(Sec);
     Res = Sect.size;
@@ -702,8 +703,8 @@ MachOObjectFile::getSectionSize(DataRefImpl Sec, uint64_t &Res) const {
   return object_error::success;
 }
 
-error_code
-MachOObjectFile::getSectionContents(DataRefImpl Sec, StringRef &Res) const {
+std::error_code MachOObjectFile::getSectionContents(DataRefImpl Sec,
+                                                    StringRef &Res) const {
   uint32_t Offset;
   uint64_t Size;
 
@@ -721,8 +722,8 @@ MachOObjectFile::getSectionContents(DataRefImpl Sec, StringRef &Res) const {
   return object_error::success;
 }
 
-error_code
-MachOObjectFile::getSectionAlignment(DataRefImpl Sec, uint64_t &Res) const {
+std::error_code MachOObjectFile::getSectionAlignment(DataRefImpl Sec,
+                                                     uint64_t &Res) const {
   uint32_t Align;
   if (is64Bit()) {
     MachO::section_64 Sect = getSection64(Sec);
@@ -736,14 +737,15 @@ MachOObjectFile::getSectionAlignment(DataRefImpl Sec, uint64_t &Res) const {
   return object_error::success;
 }
 
-error_code
-MachOObjectFile::isSectionText(DataRefImpl Sec, bool &Res) const {
+std::error_code MachOObjectFile::isSectionText(DataRefImpl Sec,
+                                               bool &Res) const {
   uint32_t Flags = getSectionFlags(this, Sec);
   Res = Flags & MachO::S_ATTR_PURE_INSTRUCTIONS;
   return object_error::success;
 }
 
-error_code MachOObjectFile::isSectionData(DataRefImpl Sec, bool &Result) const {
+std::error_code MachOObjectFile::isSectionData(DataRefImpl Sec,
+                                               bool &Result) const {
   uint32_t Flags = getSectionFlags(this, Sec);
   unsigned SectionType = Flags & MachO::SECTION_TYPE;
   Result = !(Flags & MachO::S_ATTR_PURE_INSTRUCTIONS) &&
@@ -752,7 +754,8 @@ error_code MachOObjectFile::isSectionData(DataRefImpl Sec, bool &Result) const {
   return object_error::success;
 }
 
-error_code MachOObjectFile::isSectionBSS(DataRefImpl Sec, bool &Result) const {
+std::error_code MachOObjectFile::isSectionBSS(DataRefImpl Sec,
+                                              bool &Result) const {
   uint32_t Flags = getSectionFlags(this, Sec);
   unsigned SectionType = Flags & MachO::SECTION_TYPE;
   Result = !(Flags & MachO::S_ATTR_PURE_INSTRUCTIONS) &&
@@ -761,7 +764,7 @@ error_code MachOObjectFile::isSectionBSS(DataRefImpl Sec, bool &Result) const {
   return object_error::success;
 }
 
-error_code
+std::error_code
 MachOObjectFile::isSectionRequiredForExecution(DataRefImpl Sec,
                                                bool &Result) const {
   // FIXME: Unimplemented.
@@ -769,15 +772,15 @@ MachOObjectFile::isSectionRequiredForExecution(DataRefImpl Sec,
   return object_error::success;
 }
 
-error_code MachOObjectFile::isSectionVirtual(DataRefImpl Sec,
-                                             bool &Result) const {
+std::error_code MachOObjectFile::isSectionVirtual(DataRefImpl Sec,
+                                                  bool &Result) const {
   // FIXME: Unimplemented.
   Result = false;
   return object_error::success;
 }
 
-error_code
-MachOObjectFile::isSectionZeroInit(DataRefImpl Sec, bool &Res) const {
+std::error_code MachOObjectFile::isSectionZeroInit(DataRefImpl Sec,
+                                                   bool &Res) const {
   uint32_t Flags = getSectionFlags(this, Sec);
   unsigned SectionType = Flags & MachO::SECTION_TYPE;
   Res = SectionType == MachO::S_ZEROFILL ||
@@ -785,8 +788,8 @@ MachOObjectFile::isSectionZeroInit(DataRefImpl Sec, bool &Res) const {
   return object_error::success;
 }
 
-error_code MachOObjectFile::isSectionReadOnlyData(DataRefImpl Sec,
-                                                  bool &Result) const {
+std::error_code MachOObjectFile::isSectionReadOnlyData(DataRefImpl Sec,
+                                                       bool &Result) const {
   // Consider using the code from isSectionText to look for __const sections.
   // Alternately, emit S_ATTR_PURE_INSTRUCTIONS and/or S_ATTR_SOME_INSTRUCTIONS
   // to use section attributes to distinguish code from data.
@@ -796,9 +799,9 @@ error_code MachOObjectFile::isSectionReadOnlyData(DataRefImpl Sec,
   return object_error::success;
 }
 
-error_code
-MachOObjectFile::sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
-                                       bool &Result) const {
+std::error_code MachOObjectFile::sectionContainsSymbol(DataRefImpl Sec,
+                                                       DataRefImpl Symb,
+                                                       bool &Result) const {
   SymbolRef::Type ST;
   this->getSymbolType(Symb, ST);
   if (ST == SymbolRef::ST_Unknown) {
@@ -846,8 +849,8 @@ void MachOObjectFile::moveRelocationNext(DataRefImpl &Rel) const {
   ++Rel.d.b;
 }
 
-error_code
-MachOObjectFile::getRelocationAddress(DataRefImpl Rel, uint64_t &Res) const {
+std::error_code MachOObjectFile::getRelocationAddress(DataRefImpl Rel,
+                                                      uint64_t &Res) const {
   uint64_t Offset;
   getRelocationOffset(Rel, Offset);
 
@@ -859,8 +862,8 @@ MachOObjectFile::getRelocationAddress(DataRefImpl Rel, uint64_t &Res) const {
   return object_error::success;
 }
 
-error_code MachOObjectFile::getRelocationOffset(DataRefImpl Rel,
-                                                uint64_t &Res) const {
+std::error_code MachOObjectFile::getRelocationOffset(DataRefImpl Rel,
+                                                     uint64_t &Res) const {
   assert(getHeader().filetype == MachO::MH_OBJECT &&
          "Only implemented for MH_OBJECT");
   MachO::any_relocation_info RE = getRelocation(Rel);
@@ -886,14 +889,14 @@ MachOObjectFile::getRelocationSymbol(DataRefImpl Rel) const {
   return symbol_iterator(SymbolRef(Sym, this));
 }
 
-error_code MachOObjectFile::getRelocationType(DataRefImpl Rel,
-                                              uint64_t &Res) const {
+std::error_code MachOObjectFile::getRelocationType(DataRefImpl Rel,
+                                                   uint64_t &Res) const {
   MachO::any_relocation_info RE = getRelocation(Rel);
   Res = getAnyRelocationType(RE);
   return object_error::success;
 }
 
-error_code
+std::error_code
 MachOObjectFile::getRelocationTypeName(DataRefImpl Rel,
                                        SmallVectorImpl<char> &Result) const {
   StringRef res;
@@ -1006,7 +1009,7 @@ MachOObjectFile::getRelocationTypeName(DataRefImpl Rel,
   return object_error::success;
 }
 
-error_code
+std::error_code
 MachOObjectFile::getRelocationValueString(DataRefImpl Rel,
                                           SmallVectorImpl<char> &Result) const {
   MachO::any_relocation_info RE = getRelocation(Rel);
@@ -1182,8 +1185,8 @@ MachOObjectFile::getRelocationValueString(DataRefImpl Rel,
   return object_error::success;
 }
 
-error_code
-MachOObjectFile::getRelocationHidden(DataRefImpl Rel, bool &Result) const {
+std::error_code MachOObjectFile::getRelocationHidden(DataRefImpl Rel,
+                                                     bool &Result) const {
   unsigned Arch = getArch();
   uint64_t Type;
   getRelocationType(Rel, Type);
@@ -1210,13 +1213,13 @@ MachOObjectFile::getRelocationHidden(DataRefImpl Rel, bool &Result) const {
   return object_error::success;
 }
 
-error_code MachOObjectFile::getLibraryNext(DataRefImpl LibData,
-                                           LibraryRef &Res) const {
+std::error_code MachOObjectFile::getLibraryNext(DataRefImpl LibData,
+                                                LibraryRef &Res) const {
   report_fatal_error("Needed libraries unimplemented in MachOObjectFile");
 }
 
-error_code MachOObjectFile::getLibraryPath(DataRefImpl LibData,
-                                           StringRef &Res) const {
+std::error_code MachOObjectFile::getLibraryPath(DataRefImpl LibData,
+                                                StringRef &Res) const {
   report_fatal_error("Needed libraries unimplemented in MachOObjectFile");
 }
 
@@ -1367,8 +1370,8 @@ guess_qtx:
 // normal two-level namespace default (that is MH_TWOLEVEL in the header).
 // It is passed the index (0 - based) of the library as translated from
 // GET_LIBRARY_ORDINAL (1 - based).
-error_code MachOObjectFile::getLibraryShortNameByIndex(unsigned Index,
-                                                       StringRef &Res) {
+std::error_code MachOObjectFile::getLibraryShortNameByIndex(unsigned Index,
+                                                            StringRef &Res) {
   if (Index >= Libraries.size())
     return object_error::parse_failed;
 
@@ -1818,7 +1821,7 @@ void MachOObjectFile::ReadULEB128s(uint64_t Index,
 ErrorOr<ObjectFile *> ObjectFile::createMachOObjectFile(MemoryBuffer *Buffer,
                                                         bool BufferOwned) {
   StringRef Magic = Buffer->getBuffer().slice(0, 4);
-  error_code EC;
+  std::error_code EC;
   std::unique_ptr<MachOObjectFile> Ret;
   if (Magic == "\xFE\xED\xFA\xCE")
     Ret.reset(new MachOObjectFile(Buffer, false, false, EC, BufferOwned));
index 5085efde5ecfbeece709c9122bc355b32ae549d4..1d450042733cd3675189614e0e27f58594c8970b 100644 (file)
@@ -21,6 +21,7 @@
 
 using namespace llvm;
 using namespace object;
+using std::error_code;
 
 template<typename T>
 static void SwapValue(T &Value) {
index b0068a87b0deb97deed568317287550b717f7bb2..8792345c79876e9d887e197114e3b711d2de8966 100644 (file)
@@ -18,6 +18,7 @@
 
 using namespace llvm;
 using namespace object;
+using std::error_code;
 
 inline ObjectFile *unwrap(LLVMObjectFileRef OF) {
   return reinterpret_cast<ObjectFile*>(OF);
index 0be972e26b7eaf7a780b5d97a58b1ca1b87749f1..5d4324923445812c5168602d0c047658613fd804 100644 (file)
@@ -20,6 +20,7 @@
 
 using namespace llvm;
 using namespace object;
+using std::error_code;
 
 void ObjectFile::anchor() { }
 
index 7014f5e5cc8c834464ee70e604b74becbc89219d..8d3ec5d2a3111b51b7a8669b02e72c1e4f7913b5 100644 (file)
@@ -20,6 +20,7 @@
 #include <cassert>
 
 using namespace llvm;
+using std::error_code;
 
 static error_code setupMemoryBuffer(std::string Path,
                                     std::unique_ptr<MemoryBuffer> &Buffer) {
index 83c41d93bb1814f6ca305dddaa60f1486bf2152a..e55c299181367c99c68d8f357e3436f908bc9b7e 100644 (file)
@@ -66,9 +66,10 @@ public:
 };
 }
 
-error_code InstrProfWriter::addFunctionCounts(StringRef FunctionName,
-                                              uint64_t FunctionHash,
-                                              ArrayRef<uint64_t> Counters) {
+std::error_code
+InstrProfWriter::addFunctionCounts(StringRef FunctionName,
+                                   uint64_t FunctionHash,
+                                   ArrayRef<uint64_t> Counters) {
   auto Where = FunctionData.find(FunctionName);
   if (Where == FunctionData.end()) {
     // If this is the first time we've seen this function, just add it.
index 830bd8adb9b99501ea4caacc7d9bd67b6ee64b7d..0d8a800d70e35d50616b3f766b0b83cd1deecc9c 100644 (file)
@@ -28,6 +28,7 @@
 #include <io.h>
 #endif
 using namespace llvm;
+using std::error_code;
 
 #define DEBUG_TYPE "Data-stream"
 
index 96fa58767edd81cd6e52ec209aa1e936ce9c0a13..68f6fa16f965bc8d62e554e2133782ba10cbbb6d 100644 (file)
@@ -17,6 +17,7 @@
 #include <system_error>
 
 using llvm::sys::fs::mapped_file_region;
+using std::error_code;
 
 namespace llvm {
 FileOutputBuffer::FileOutputBuffer(mapped_file_region * R,
index 68953d347fe06567ff198e4514507924ba715c73..729e44789cdf5b4d1e0fa87766cecf024fe4d02e 100644 (file)
@@ -22,6 +22,7 @@
 #include <cstring>
 #include <system_error>
 using namespace llvm;
+using std::error_code;
 
 static bool isSignedChar(char C) {
   return (C == '+' || C == '-');
index 306f3e89d0d7013bff37539e7ef8c98b5aa66156..e68ee434dd592557d0d44ca84191ee80cedf04ea 100644 (file)
@@ -68,7 +68,7 @@ StringRef llvm::DOT::getColorString(unsigned ColorNumber) {
 std::string llvm::createGraphFilename(const Twine &Name, int &FD) {
   FD = -1;
   SmallString<128> Filename;
-  error_code EC = sys::fs::createTemporaryFile(Name, "dot", FD, Filename);
+  std::error_code EC = sys::fs::createTemporaryFile(Name, "dot", FD, Filename);
   if (EC) {
     errs() << "Error: " << EC.message() << "\n";
     return "";
index b050e5de8d48720982dc2ce8da6c3930ff7fac35..0204e75f84ee1da715f6d7e8b71a5eaefe718b0d 100644 (file)
@@ -22,6 +22,7 @@
 #include <unistd.h>
 #endif
 using namespace llvm;
+using std::error_code;
 
 /// \brief Attempt to read the lock file with the given name, if it exists.
 ///
index 0164443ad5fdb20f48a4d7adef60f26c6cde6358..c395ce72b8d3461464d7d900e18ee064693378de 100644 (file)
@@ -33,6 +33,7 @@
 #include <io.h>
 #endif
 using namespace llvm;
+using std::error_code;
 
 //===----------------------------------------------------------------------===//
 // MemoryBuffer implementation itself.
index dabf763c8dbf637a9053614e1354330e9befc1eb..13e3a8ad02f3af7a3368e32fde6834ed181d4110 100644 (file)
@@ -28,6 +28,7 @@
 #endif
 
 using namespace llvm;
+using std::error_code;
 
 namespace {
   using llvm::StringRef;
index 10de038f4373483ef0ea29d164e959ee4257e224..cca37829497ac0a16ff0126bafd3ab71bd27eff6 100644 (file)
@@ -37,6 +37,7 @@ extern "C" void sys_icache_invalidate(const void *Addr, size_t len);
 #else
 extern "C" void __clear_cache(void *, void*);
 #endif
+using std::error_code;
 
 namespace {
 
index d927bb539ed94158f89e6dd35c9f7c5a05d8814e..ea2b8dcda265dd29855b33a5814c16bee3c56fd4 100644 (file)
@@ -46,7 +46,7 @@
 
 using namespace llvm;
 using namespace sys;
-
+using std::error_code;
 
 process::id_type self_process::get_id() {
   return getpid();
index f4c6cdf7e99740b287b5e67d2786b71fce1c7048..d8506643349c435ac87c95378ffb8a28d8717e90 100644 (file)
@@ -48,6 +48,8 @@
 #endif
 
 namespace llvm {
+using std::error_code;
+
 using namespace sys;
 
 ProcessInfo::ProcessInfo() : Pid(0), ReturnCode(0) {}
index d410df35aa0681ba80e2a35fc320dc111b6a7424..431cfb6cf99fbeb69f3f3ececd24f1b3fd7374a4 100644 (file)
@@ -19,6 +19,7 @@
 
 // The Windows.h header must be the last one included.
 #include "WindowsSupport.h"
+using std::error_code;
 
 namespace {
 
index 0be871c695c0a72a838a7c9ca6e82c4d76ca53fd..c88557c5eef7f8a9b3dd60a720aa22ad13682521 100644 (file)
@@ -48,7 +48,7 @@
 
 using namespace llvm;
 using namespace sys;
-
+using std::error_code;
 
 process::id_type self_process::get_id() {
   return GetCurrentProcessId();
index 6c7ddbde332cabc1eb9ed2fb07f8734523bc9e7e..8d1df5ffc922def5df2bf0bdf106f02701d160d0 100644 (file)
@@ -24,6 +24,7 @@
 //===----------------------------------------------------------------------===//
 
 namespace llvm {
+using std::error_code;
 using namespace sys;
 
 ProcessInfo::ProcessInfo() : ProcessHandle(0), Pid(0), ReturnCode(0) {}
index 66af33693d67545745bc8d5e71b91a69dde727b7..0042c29036226b6908779a5c40edea2e3aa6f9da 100644 (file)
@@ -18,6 +18,7 @@
 #include <cstring>
 using namespace llvm;
 using namespace yaml;
+using std::error_code;
 
 //===----------------------------------------------------------------------===//
 //  IO
index 6a61b1b2a6ccc2b709c6b004b7a3a4051c1e2aa2..f7c213ac2b85127ecc63a28cace6d6258163e35a 100644 (file)
@@ -450,7 +450,7 @@ raw_fd_ostream::raw_fd_ostream(const char *Filename, std::string &ErrorInfo,
     return;
   }
 
-  error_code EC = sys::fs::openFileForWrite(Filename, FD, Flags);
+  std::error_code EC = sys::fs::openFileForWrite(Filename, FD, Flags);
 
   if (EC) {
     ErrorInfo = "Error opening output file '" + std::string(Filename) + "': " +
index c932668fded799cd4c37c4e8e9367fb48e3e9d15..c757b852a42c783c845730a943e8b8cde42fb5be 100644 (file)
@@ -27,6 +27,7 @@
 #include <cstdio>
 #include <system_error>
 using namespace llvm;
+using std::error_code;
 
 namespace {
   cl::opt<std::string>
index 8e557aaa2f265f19ab2f4b63055d0c52fdf4892f..4b97295d17ca667fccc5d4fe65a3136963cf42c9 100644 (file)
@@ -51,6 +51,7 @@
 #include <cctype>
 
 using namespace llvm;
+using std::error_code;
 
 #define DEBUG_TYPE "sample-profile"
 
index 5d5606ba47b0d5dec7ca2f523f646ebd10a79aee..a09e4853fb32da8a1c09db830d143ceafe0acd8a 100644 (file)
@@ -36,6 +36,7 @@
 #include "llvm/Pass.h"
 #include "llvm/Transforms/Utils/Local.h"
 using namespace llvm;
+using std::error_code;
 
 #define DEBUG_TYPE "simplifycfg"
 
index 0a07b8f1ab5d1615c5b1c910134cc84539863396..8ae36fe833f3684c7a2e7db07e42e219b79f527e 100644 (file)
@@ -31,6 +31,7 @@
 #include <utility>
 
 namespace llvm {
+using std::error_code;
 
 /// Represents a set of regular expressions.  Regular expressions which are
 /// "literal" (i.e. no regex metacharacters) are stored in Strings, while all
index 5ed7d2cab3c7a252640ff20b57656c6eb7ea1ed1..b41a4b0334687a531133b181847e81484a1c0d7e 100644 (file)
@@ -22,6 +22,7 @@
 #include <fstream>
 
 using namespace llvm;
+using std::error_code;
 
 namespace {
   // OutputType - Allow the user to specify the way code should be run, to test
index 38cdf241ce767394bd3cdb31ccbdb6f5603bb6cb..a257840b6e0deafbae61454ab1e65a6c116be86b 100644 (file)
@@ -33,6 +33,7 @@
 #include "llvm/Transforms/Utils/CodeExtractor.h"
 #include <set>
 using namespace llvm;
+using std::error_code;
 
 #define DEBUG_TYPE "bugpoint"
 
index f5936ac88ea5e20fffaad3fe67e81ab30a3f7c50..5143fa1f0372fca03f9530fd66d89739e66c7f6d 100644 (file)
@@ -27,6 +27,7 @@
 #include "llvm/Support/FileUtilities.h"
 #include "llvm/Transforms/Utils/Cloning.h"
 using namespace llvm;
+using std::error_code;
 
 namespace llvm {
   extern cl::opt<std::string> OutputPrefix;
index b2722e6d0e7d5fd1a83fa98ab69769b4ecf04b8e..85790b0c63115d72629dd0dbad6e704182c6e0d3 100644 (file)
@@ -35,6 +35,7 @@
 #include <fstream>
 
 using namespace llvm;
+using std::error_code;
 
 #define DEBUG_TYPE "bugpoint"
 
index c481b03e2b9ec82eb5168de35b827adf53b389f5..ec120bb0b2fb8113d8e4d13f3342fcc2a72ecf49 100644 (file)
@@ -22,6 +22,7 @@
 #include <fstream>
 #include <sstream>
 using namespace llvm;
+using std::error_code;
 
 #define DEBUG_TYPE "toolrunner"
 
index f6b3435e2fecae3df448a6784228308cd2bf0963..2030fbd6c839f6b48c372ce59b398f7ea7089168 100644 (file)
@@ -44,6 +44,7 @@
 #endif
 
 using namespace llvm;
+using std::error_code;
 
 namespace {
   ld_plugin_status discard_message(int level, const char *format, ...) {
index 200ab75152c22fcd75817bbf3f870683315113f9..041f7c7afd0ccf23a816247acc11afb5970253b5 100644 (file)
@@ -19,6 +19,7 @@
 #include "llvm/Support/Format.h"
 
 using namespace llvm;
+using std::error_code;
 
 #define DEBUG_TYPE "lli"
 
index 4cde10579c86056d499a92acc9606d40a6f083fe..2c8a4749fdb410697ab0c844009213bbf268a1cf 100644 (file)
@@ -62,6 +62,7 @@
 #endif
 
 using namespace llvm;
+using std::error_code;
 
 #define DEBUG_TYPE "lli"
 
index 47e8d8de16edd476599c09f025ed798654ffc97b..d0d4f1477da06fc6ab0449edbbba9ed0e9a9d1d7 100644 (file)
@@ -36,6 +36,7 @@
 #endif
 
 using namespace llvm;
+using std::error_code;
 
 // The name this program was invoked as.
 static StringRef ToolName;
index d1c3525bb6a0afad590fc045abdae663aa753f23..d29c83714abe176c5f1faf67b077db9cca2c4278 100644 (file)
@@ -43,6 +43,7 @@
 #include <map>
 #include <system_error>
 using namespace llvm;
+using std::error_code;
 
 static cl::opt<std::string>
   InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
index 0917acd4110ce87cc1f3bd16c39b753d98b1c0c5..97a91dd544a3ddb6b317abbdde104964686058ca 100644 (file)
@@ -22,6 +22,7 @@
 #include "llvm/Support/Signals.h"
 #include <system_error>
 using namespace llvm;
+using std::error_code;
 
 static cl::opt<std::string> SourceFile(cl::Positional, cl::Required,
                                        cl::desc("SOURCEFILE"));
index 3a3936934f0a8ce6935ee9ea249b9239bf888e57..f5dfedbc477bee6f457e02da7486b1a88d45d34c 100644 (file)
@@ -34,6 +34,7 @@
 #include "llvm/Support/ToolOutputFile.h"
 #include <system_error>
 using namespace llvm;
+using std::error_code;
 
 static cl::opt<std::string>
 InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
index 1876362b77f6a97b4c1481f17f3abd04f11d4716..2f10f2994fa0d75bf6015e5a3b3dfd95f0913837 100644 (file)
@@ -33,6 +33,7 @@
 
 using namespace llvm;
 using namespace object;
+using std::error_code;
 
 static cl::list<std::string>
 InputFilenames(cl::Positional, cl::desc("<input object files>"),
index e5d38d2e27da0edc54bf4a78feceae5f5ac36304..24a2d6f208ee40871991be04a53606bc59192293 100644 (file)
@@ -40,6 +40,7 @@
 #include "llvm/Support/TargetSelect.h"
 #include "llvm/Support/ToolOutputFile.h"
 using namespace llvm;
+using std::error_code;
 
 static cl::opt<std::string>
 InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-"));
index 7eb14d22a9dbb1c45988a5a9285cefd904ce33ee..e8416d6012617e073200d867fbc142dd38680973 100644 (file)
@@ -21,6 +21,7 @@
 #include "llvm/Support/raw_ostream.h"
 #include <system_error>
 using namespace llvm;
+using std::error_code;
 
 static cl::list<std::string>
        InputFilenames(cl::Positional, cl::desc("<input files>"),
index ec7b29824b470b39a2d4da6fd7d463c48bff4642..6476a60c7e1133cad51b6d4ae3dcf50cd8307a39 100644 (file)
@@ -45,6 +45,7 @@
 #include <vector>
 using namespace llvm;
 using namespace object;
+using std::error_code;
 
 namespace {
 enum OutputFormatTy { bsd, sysv, posix, darwin };
index 974a83721e5dded7c5cc0071be626819faa82cb9..254c802aec458d0f66e46d46ab24a9539552f2e5 100644 (file)
@@ -64,6 +64,7 @@
 
 using namespace llvm;
 using namespace object;
+using std::error_code;
 
 static cl::list<std::string>
 InputFilenames(cl::Positional, cl::desc("<input object files>"),cl::ZeroOrMore);
index 30f2eea81f507f271a1a93200a6b4eb1756b31c9..32a375b8ac3cc19c5e410bc33f7fb6a0602db6b3 100644 (file)
@@ -16,6 +16,7 @@
 #include "llvm/Support/StringRefMemoryObject.h"
 
 namespace llvm {
+using std::error_code;
 
 namespace object {
   class COFFObjectFile;
index fdde32ac6bb142f8eab6e10f4bb5db5617dee5ad..9bf0897949fea04809426ff0f6bf7f14db4c6f65 100644 (file)
@@ -24,6 +24,7 @@
 #include "llvm/Support/raw_ostream.h"
 
 using namespace llvm;
+using std::error_code;
 
 static void exitWithError(const Twine &Message, StringRef Whence = "") {
   errs() << "error: ";
index 7608cfbbd8d103f3492afbee94fba76e2c863da2..716c9a1a48e99a1c27f9733b112dbbb9f15bdb15 100644 (file)
@@ -22,6 +22,7 @@
 #include "llvm/Support/type_traits.h"
 
 namespace llvm {
+using std::error_code;
 namespace ARM {
 namespace EHABI {
 
index eddcaf4d96f944bb080ad3908eb76fc6567e5049..e758bbf124785b5356c74e4607e1a6d990d94f10 100644 (file)
@@ -15,6 +15,7 @@
 #include "llvm/Support/ErrorOr.h"
 
 namespace llvm {
+using std::error_code;
 namespace ARM {
 namespace WinEH {
 class RuntimeFunction;
index c64d362469bf8728aec33b020e716dc5642d0bdd..f3749fc36ccc2d362be9f9e463edf6d8bc9ae0a6 100644 (file)
@@ -16,6 +16,7 @@
 using namespace llvm;
 using namespace llvm::object;
 using namespace llvm::Win64EH;
+using std::error_code;
 
 static const EnumEntry<unsigned> UnwindFlags[] = {
   { "ExceptionHandler", UNW_ExceptionHandler },
index 2eac81048b4f950c1c834d1703b6df1075b32002..98055994aecf28ae160dbace325a6c5e14167fdf 100644 (file)
@@ -14,6 +14,7 @@
 #include "llvm/Support/Win64EH.h"
 
 namespace llvm {
+using std::error_code;
 namespace object {
 class COFFObjectFile;
 class SymbolRef;
index 61ee0d4ed4fc70f7a8b267acbf4328d488dfc2fb..920e74ccc9b0ba9fb3d35ec7a65c2b2e4427f690 100644 (file)
@@ -14,6 +14,7 @@
 #include <string>
 
 namespace llvm {
+using std::error_code;
   namespace object {
     class RelocationRef;
   }
index df6d535c4307bdfa93278f8072f33e080f2f614f..e86d93bd490dabde9cbf90dee5e23a1d79b6bde6 100644 (file)
@@ -28,6 +28,7 @@
 #include <system_error>
 using namespace llvm;
 using namespace llvm::object;
+using std::error_code;
 
 static cl::list<std::string>
 InputFileList(cl::Positional, cl::ZeroOrMore,
index ff3b88e3169f530e57f6d5a0b07729ae26c847e0..f0ec7fa6af6a38c56fe90205f0d685ee2a17af5d 100644 (file)
@@ -30,6 +30,7 @@
 #include <system_error>
 using namespace llvm;
 using namespace object;
+using std::error_code;
 
 enum OutputFormatTy {berkeley, sysv};
 static cl::opt<OutputFormatTy>
index 125e63f225492713d83694b9847ac91dedbd74fe..61c4e8ad209b5cb77517186cc6ef895281a394b2 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdlib.h>
 
 namespace llvm {
+using std::error_code;
 namespace symbolize {
 
 static bool error(error_code ec) {
index 29db172531bab9fb58e3c3297bd2917fcb5e7ce4..2ee30e816e489f1523bb9a156f7ce4755b9798ec 100644 (file)
@@ -29,6 +29,7 @@
 
 using namespace llvm;
 using namespace symbolize;
+using std::error_code;
 
 static cl::opt<bool>
 ClUseSymbolTable("use-symbol-table", cl::init(true),
index e7575f0056f0ed2bef16d1872519d081ccb36d26..13e8a4b80ca98933ada125d958bbaee34eaf3548 100644 (file)
@@ -23,6 +23,7 @@
 #include <system_error>
 using namespace llvm;
 using namespace llvm::object;
+using std::error_code;
 
 static cl::opt<std::string>
 InputFile(cl::Positional, cl::desc("<input file>"), cl::init("-"));
index 42b09d312c253d1d76577c9020923ba35ef46743..816f9e65cde1362a5657808d21c31f9fc77d5be4 100644 (file)
@@ -14,6 +14,7 @@
 #include "llvm/Support/YAMLTraits.h"
 
 using namespace llvm;
+using std::error_code;
 
 namespace {
 
index 5eb52c6f0178705bdcdb669af88304435625ca6d..f3b2b21c0912cdba6946e0deddfb48643d09d197 100644 (file)
@@ -31,6 +31,7 @@
 #include <vector>
 
 using namespace llvm;
+using std::error_code;
 
 // This variable is intentionally defined differently in the statically-compiled
 // program from the IR input to the JIT to assert that the JIT doesn't use its
index 2ce9e71f8527ef779e404df5d84074a406040499..aec3524bb4a75842629f1cf7758d9f4549357b7c 100644 (file)
@@ -16,6 +16,7 @@
 
 using namespace llvm;
 using namespace llvm::sys;
+using std::error_code;
 
 #define ASSERT_NO_ERROR(x) \
   if (error_code ASSERT_NO_ERROR_ec = x) { \
index 93fa10bee07d092094597ed6982cf7da09e2b1f8..3d6357c291b3525147020ef8431048ad0a569090 100644 (file)
@@ -14,6 +14,7 @@
 #include <memory>
 
 using namespace llvm;
+using std::error_code;
 
 namespace {
 
index b7d0c206e8e01075c764d5406d20dbf1ec3f0775..7802537c35873f0bdd78c6808f0e9943d4633474 100644 (file)
@@ -17,6 +17,7 @@
 #include "gtest/gtest.h"
 
 using namespace llvm;
+using std::error_code;
 
 namespace {
 
index f85f3dc3128f50d72a038fe02aac689fc842ebe6..70f8b24dc083de8d4aa708a9b964342de163e4e1 100644 (file)
@@ -14,6 +14,7 @@
 
 using namespace llvm;
 using namespace sys;
+using std::error_code;
 
 namespace {
 
index f5fb81539b6d21a1675d7be8da7cd8b18e652663..09042113c01736919758958a2a66caca629b5a79 100644 (file)
@@ -20,6 +20,7 @@
 
 using namespace llvm;
 using namespace llvm::sys;
+using std::error_code;
 
 #define ASSERT_NO_ERROR(x) \
   if (error_code ASSERT_NO_ERROR_ec = x) { \
index a5ec07f9550d66e2fe429d21df1940520faef807..190a2ad52d9f7049f2ea1450a830d6c28b741cb2 100644 (file)
@@ -34,6 +34,7 @@
 #include <system_error>
 #include <vector>
 using namespace llvm;
+using std::error_code;
 
 static cl::opt<std::string>
 CheckFilename(cl::Positional, cl::desc("<check-file>"), cl::Required);
index 9e494bfca6f2c4f2f1f85d664a65cb384c9af2f8..2bf5e067a4e9170539c2a95b9a4032a24db16549 100644 (file)
@@ -21,6 +21,7 @@
 #include "llvm/Support/ToolOutputFile.h"
 #include <system_error>
 using namespace llvm;
+using std::error_code;
 
 static cl::opt<bool>
 Quiet("quiet", cl::desc("Don't print unnecessary status information"),