Don't import error_code into the lld namespace.
llvm-svn: 210785
diff --git a/lld/lib/Driver/Driver.cpp b/lld/lib/Driver/Driver.cpp
index 8a03353..e8567ed 100644
--- a/lld/lib/Driver/Driver.cpp
+++ b/lld/lib/Driver/Driver.cpp
@@ -63,7 +63,7 @@
       std::string buf;
       llvm::raw_string_ostream stream(buf);
 
-      if (error_code ec = ie->parse(context, stream)) {
+      if (std::error_code ec = ie->parse(context, stream)) {
         if (FileNode *fileNode = dyn_cast<FileNode>(ie.get()))
           stream << fileNode->errStr(ec) << "\n";
         else if (dyn_cast<Group>(ie.get()))
@@ -130,7 +130,7 @@
 
   // Give linked atoms to Writer to generate output file.
   ScopedTask writeTask(getDefaultDomain(), "Write");
-  if (error_code ec = context.writeFile(*merged)) {
+  if (std::error_code ec = context.writeFile(*merged)) {
     diagnostics << "Failed to write file '" << context.outputPath()
                 << "': " << ec.message() << "\n";
     return false;
diff --git a/lld/lib/Driver/GnuLdDriver.cpp b/lld/lib/Driver/GnuLdDriver.cpp
index ea98251..2b929ca 100644
--- a/lld/lib/Driver/GnuLdDriver.cpp
+++ b/lld/lib/Driver/GnuLdDriver.cpp
@@ -112,9 +112,9 @@
 }
 
 // Get the Input file magic for creating appropriate InputGraph nodes.
-static error_code getFileMagic(ELFLinkingContext &ctx, StringRef path,
-                               llvm::sys::fs::file_magic &magic) {
-  error_code ec = llvm::sys::fs::identify_magic(path, magic);
+static std::error_code getFileMagic(ELFLinkingContext &ctx, StringRef path,
+                                    llvm::sys::fs::file_magic &magic) {
+  std::error_code ec = llvm::sys::fs::identify_magic(path, magic);
   if (ec)
     return ec;
   switch (magic) {
@@ -122,7 +122,7 @@
   case llvm::sys::fs::file_magic::elf_relocatable:
   case llvm::sys::fs::file_magic::elf_shared_object:
   case llvm::sys::fs::file_magic::unknown:
-    return error_code();
+    return std::error_code();
   default:
     break;
   }
@@ -158,7 +158,7 @@
   return _elfLinkingContext.searchFile(_path, _attributes._isSysRooted);
 }
 
-std::string ELFFileNode::errStr(error_code errc) {
+std::string ELFFileNode::errStr(std::error_code errc) {
   if (errc == std::errc::no_such_file_or_directory) {
     if (_attributes._isDashlPrefix)
       return (Twine("Unable to find library -l") + _path).str();
@@ -485,7 +485,7 @@
       // FIXME: Calling getFileMagic() is expensive.  It would be better to
       // wire up the LdScript parser into the registry.
       llvm::sys::fs::file_magic magic = llvm::sys::fs::file_magic::unknown;
-      error_code ec = getFileMagic(*ctx, resolvedInputPath, magic);
+      std::error_code ec = getFileMagic(*ctx, resolvedInputPath, magic);
       if (ec) {
         diagnostics << "lld: unknown input file format for file " << userPath
                     << "\n";
diff --git a/lld/lib/Driver/GnuLdInputGraph.cpp b/lld/lib/Driver/GnuLdInputGraph.cpp
index febc737..d463e5f 100644
--- a/lld/lib/Driver/GnuLdInputGraph.cpp
+++ b/lld/lib/Driver/GnuLdInputGraph.cpp
@@ -16,19 +16,19 @@
 using namespace lld;
 
 /// \brief Parse the input file to lld::File.
-error_code ELFFileNode::parse(const LinkingContext &ctx,
-                              raw_ostream &diagnostics) {
+std::error_code ELFFileNode::parse(const LinkingContext &ctx,
+                                   raw_ostream &diagnostics) {
   ErrorOr<StringRef> filePath = getPath(ctx);
-  if (error_code ec = filePath.getError())
+  if (std::error_code ec = filePath.getError())
     return ec;
-  if (error_code ec = getBuffer(*filePath))
+  if (std::error_code ec = getBuffer(*filePath))
     return ec;
   if (ctx.logInputFiles())
     diagnostics << *filePath << "\n";
 
   if (_attributes._isWholeArchive) {
     std::vector<std::unique_ptr<File>> parsedFiles;
-    if (error_code ec = ctx.registry().parseFile(_buffer, parsedFiles))
+    if (std::error_code ec = ctx.registry().parseFile(_buffer, parsedFiles))
       return ec;
     assert(parsedFiles.size() == 1);
     std::unique_ptr<File> f(parsedFiles[0].release());
@@ -41,18 +41,18 @@
     }
     // if --whole-archive is around non-archive, just use it as normal.
     _files.push_back(std::move(f));
-    return error_code();
+    return std::error_code();
   }
   return ctx.registry().parseFile(_buffer, _files);
 }
 
 /// \brief Parse the GnuLD Script
-error_code GNULdScript::parse(const LinkingContext &ctx,
-                              raw_ostream &diagnostics) {
+std::error_code GNULdScript::parse(const LinkingContext &ctx,
+                                   raw_ostream &diagnostics) {
   ErrorOr<StringRef> filePath = getPath(ctx);
-  if (error_code ec = filePath.getError())
+  if (std::error_code ec = filePath.getError())
     return ec;
-  if (error_code ec = getBuffer(*filePath))
+  if (std::error_code ec = getBuffer(*filePath))
     return ec;
 
   if (ctx.logInputFiles())
@@ -66,7 +66,7 @@
   if (!_linkerScript)
     return LinkerScriptReaderError::parse_error;
 
-  return error_code();
+  return std::error_code();
 }
 
 static bool isPathUnderSysroot(StringRef sysroot, StringRef path) {
@@ -82,10 +82,10 @@
 }
 
 /// \brief Handle GnuLD script for ELF.
-error_code ELFGNULdScript::parse(const LinkingContext &ctx,
-                                 raw_ostream &diagnostics) {
+std::error_code ELFGNULdScript::parse(const LinkingContext &ctx,
+                                      raw_ostream &diagnostics) {
   ELFFileNode::Attributes attributes;
-  if (error_code ec = GNULdScript::parse(ctx, diagnostics))
+  if (std::error_code ec = GNULdScript::parse(ctx, diagnostics))
     return ec;
   StringRef sysRoot = _elfLinkingContext.getSysroot();
   if (!sysRoot.empty() && isPathUnderSysroot(sysRoot, *getPath(ctx)))
@@ -106,5 +106,5 @@
     }
     _expandElements.push_back(std::move(groupStart));
   }
-  return error_code();
+  return std::error_code();
 }
diff --git a/lld/lib/Driver/WinLinkInputGraph.cpp b/lld/lib/Driver/WinLinkInputGraph.cpp
index fd6f5b5..8696c8f 100644
--- a/lld/lib/Driver/WinLinkInputGraph.cpp
+++ b/lld/lib/Driver/WinLinkInputGraph.cpp
@@ -16,18 +16,18 @@
 }
 
 /// \brief Parse the input file to lld::File.
-error_code PECOFFFileNode::parse(const LinkingContext &ctx,
-                                 raw_ostream &diagnostics) {
+std::error_code PECOFFFileNode::parse(const LinkingContext &ctx,
+                                      raw_ostream &diagnostics) {
   if (_parsed)
-    return error_code();
+    return std::error_code();
   _parsed = true;
   ErrorOr<StringRef> filePath = getPath(ctx);
-  if (error_code ec = filePath.getError()) {
+  if (std::error_code ec = filePath.getError()) {
     diagnostics << "File not found: " << _path << "\n";
     return ec;
   }
 
-  if (error_code ec = getBuffer(*filePath)) {
+  if (std::error_code ec = getBuffer(*filePath)) {
     diagnostics << "Cannot open file: " << *filePath << "\n";
     return ec;
   }