[lld] r210741 - Don't use make_error_code from the llvm namespace.

Rafael Espindola rafael.espindola at gmail.com
Wed Jun 11 20:13:49 PDT 2014


Author: rafael
Date: Wed Jun 11 22:13:49 2014
New Revision: 210741

URL: http://llvm.org/viewvc/llvm-project?rev=210741&view=rev
Log:
Don't use make_error_code from the llvm namespace.

Modified:
    lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp
    lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
    lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
    lld/trunk/lib/ReaderWriter/Reader.cpp
    lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp

Modified: lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp?rev=210741&r1=210740&r2=210741&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp Wed Jun 11 22:13:49 2014
@@ -178,7 +178,7 @@ ErrorOr<StringRef> ELFLinkingContext::se
       return StringRef(*new (_allocator) std::string(path.str()));
   }
   if (!llvm::sys::fs::exists(libName))
-    return llvm::make_error_code(std::errc::no_such_file_or_directory);
+    return std::make_error_code(std::errc::no_such_file_or_directory);
 
   return libName;
 }
@@ -195,7 +195,7 @@ ErrorOr<StringRef> ELFLinkingContext::se
     return fileName;
 
   if (llvm::sys::path::is_absolute(fileName))
-    return llvm::make_error_code(std::errc::no_such_file_or_directory);
+    return std::make_error_code(std::errc::no_such_file_or_directory);
 
   for (StringRef dir : _inputSearchPaths) {
     buildSearchPath(path, dir, _sysrootPath);
@@ -203,7 +203,7 @@ ErrorOr<StringRef> ELFLinkingContext::se
     if (llvm::sys::fs::exists(path.str()))
       return StringRef(*new (_allocator) std::string(path.str()));
   }
-  return llvm::make_error_code(std::errc::no_such_file_or_directory);
+  return std::make_error_code(std::errc::no_such_file_or_directory);
 }
 
 void ELFLinkingContext::createInternalFiles(

Modified: lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp?rev=210741&r1=210740&r2=210741&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp Wed Jun 11 22:13:49 2014
@@ -65,7 +65,7 @@ forEachLoadCommand(StringRef lcRange, un
       slc = &lcCopy;
     }
     if ( (p + slc->cmdsize) > lcRange.end() )
-      return llvm::make_error_code(std::errc::executable_format_error);
+      return std::make_error_code(std::errc::executable_format_error);
 
     if (func(slc->cmd, slc->cmdsize, p))
       return error_code();
@@ -81,7 +81,7 @@ static error_code
 appendRelocations(Relocations &relocs, StringRef buffer, bool swap,
                              bool bigEndian, uint32_t reloff, uint32_t nreloc) {
   if ((reloff + nreloc*8) > buffer.size())
-    return llvm::make_error_code(std::errc::executable_format_error);
+    return std::make_error_code(std::errc::executable_format_error);
   const any_relocation_info* relocsArray =
             reinterpret_cast<const any_relocation_info*>(buffer.begin()+reloff);
 
@@ -96,9 +96,9 @@ appendIndirectSymbols(IndirectSymbols &i
                       bool bigEndian, uint32_t istOffset, uint32_t istCount,
                       uint32_t startIndex, uint32_t count) {
   if ((istOffset + istCount*4) > buffer.size())
-    return llvm::make_error_code(std::errc::executable_format_error);
+    return std::make_error_code(std::errc::executable_format_error);
   if (startIndex+count  > istCount)
-    return llvm::make_error_code(std::errc::executable_format_error);
+    return std::make_error_code(std::errc::executable_format_error);
   const uint32_t *indirectSymbolArray =
             reinterpret_cast<const uint32_t*>(buffer.begin()+istOffset);
 
@@ -146,12 +146,12 @@ readBinary(std::unique_ptr<MemoryBuffer>
       fa++;
     }
     if (!foundArch) {
-      return llvm::make_error_code(std::errc::executable_format_error);
+      return std::make_error_code(std::errc::executable_format_error);
     }
     objSize = readBigEndian(fa->size);
     uint32_t offset = readBigEndian(fa->offset);
     if ((offset + objSize) > mb->getBufferSize())
-      return llvm::make_error_code(std::errc::executable_format_error);
+      return std::make_error_code(std::errc::executable_format_error);
     start += offset;
     mh = reinterpret_cast<const mach_header *>(start);
   }
@@ -175,7 +175,7 @@ readBinary(std::unique_ptr<MemoryBuffer>
     swap = true;
     break;
   default:
-    return llvm::make_error_code(std::errc::executable_format_error);
+    return std::make_error_code(std::errc::executable_format_error);
   }
 
   // Endian swap header, if needed.
@@ -193,7 +193,7 @@ readBinary(std::unique_ptr<MemoryBuffer>
       start + (is64 ? sizeof(mach_header_64) : sizeof(mach_header));
   StringRef lcRange(lcStart, smh->sizeofcmds);
   if (lcRange.end() > (start + objSize))
-    return llvm::make_error_code(std::errc::executable_format_error);
+    return std::make_error_code(std::errc::executable_format_error);
 
   // Normalize architecture
   f->arch = MachOLinkingContext::archFromCpuType(smh->cputype, smh->cpusubtype);

Modified: lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp?rev=210741&r1=210740&r2=210741&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp Wed Jun 11 22:13:49 2014
@@ -380,7 +380,7 @@ void MachOFileLayout::buildFileOffsets()
       if (&sg1 == &sg2)
         continue;
       if (overlaps(sg1,sg2)) {
-        _ec = llvm::make_error_code(std::errc::executable_format_error);
+        _ec = std::make_error_code(std::errc::executable_format_error);
         return;
       }
     }
@@ -392,7 +392,7 @@ void MachOFileLayout::buildFileOffsets()
       if (&s1 == &s2)
         continue;
       if (overlaps(s1,s2)) {
-        _ec = llvm::make_error_code(std::errc::executable_format_error);
+        _ec = std::make_error_code(std::errc::executable_format_error);
         return;
       }
     }
@@ -413,7 +413,7 @@ void MachOFileLayout::buildFileOffsets()
       if ((s.address >= sg.address)
                         && (s.address+s.content.size() <= sg.address+sg.size)) {
         if (!sg.name.equals(s.segmentName)) {
-          _ec = llvm::make_error_code(std::errc::executable_format_error);
+          _ec = std::make_error_code(std::errc::executable_format_error);
           return;
         }
         _segInfo[&sg].sections.push_back(&s);

Modified: lld/trunk/lib/ReaderWriter/Reader.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/Reader.cpp?rev=210741&r1=210740&r2=210741&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/Reader.cpp (original)
+++ lld/trunk/lib/ReaderWriter/Reader.cpp Wed Jun 11 22:13:49 2014
@@ -44,7 +44,7 @@ Registry::parseFile(std::unique_ptr<Memo
       return reader->parseFile(mb, *this, result);
 
   // No Reader could parse this file.
-  return llvm::make_error_code(std::errc::executable_format_error);
+  return std::make_error_code(std::errc::executable_format_error);
 }
 
 static const Registry::KindStrings kindStrings[] = {

Modified: lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp?rev=210741&r1=210740&r2=210741&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp (original)
+++ lld/trunk/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp Wed Jun 11 22:13:49 2014
@@ -1251,7 +1251,7 @@ public:
     std::string errorInfo;
     llvm::raw_fd_ostream out(outPath.data(), errorInfo, llvm::sys::fs::F_Text);
     if (!errorInfo.empty())
-      return llvm::make_error_code(std::errc::no_such_file_or_directory);
+      return std::make_error_code(std::errc::no_such_file_or_directory);
 
     // Create yaml Output writer, using yaml options for context.
     YamlContext yamlContext;





More information about the llvm-commits mailing list