Use error_code() instead of error_code::succes()

There is no std::error_code::success, so this removes much of the noise
in transitioning to std::error_code.

llvm-svn: 209952
diff --git a/llvm/lib/Support/Unix/Memory.inc b/llvm/lib/Support/Unix/Memory.inc
index 23b49b7..7e02244 100644
--- a/llvm/lib/Support/Unix/Memory.inc
+++ b/llvm/lib/Support/Unix/Memory.inc
@@ -84,7 +84,7 @@
                              const MemoryBlock *const NearBlock,
                              unsigned PFlags,
                              error_code &EC) {
-  EC = error_code::success();
+  EC = error_code();
   if (NumBytes == 0)
     return MemoryBlock();
 
@@ -140,7 +140,7 @@
 error_code
 Memory::releaseMappedMemory(MemoryBlock &M) {
   if (M.Address == nullptr || M.Size == 0)
-    return error_code::success();
+    return error_code();
 
   if (0 != ::munmap(M.Address, M.Size))
     return error_code(errno, system_category());
@@ -148,13 +148,13 @@
   M.Address = nullptr;
   M.Size = 0;
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code
 Memory::protectMappedMemory(const MemoryBlock &M, unsigned Flags) {
   if (M.Address == nullptr || M.Size == 0)
-    return error_code::success();
+    return error_code();
 
   if (!Flags)
     return error_code(EINVAL, generic_category());
@@ -168,7 +168,7 @@
   if (Flags & MF_EXEC)
     Memory::InvalidateInstructionCache(M.Address, M.Size);
 
-  return error_code::success();
+  return error_code();
 }
 
 /// AllocateRWX - Allocate a slab of memory with read/write/execute
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index c36c865..2925e64 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -100,7 +100,7 @@
   result.clear();
   StringRef d(dir);
   result.append(d.begin(), d.end());
-  return error_code::success();
+  return error_code();
 }
 
 namespace llvm {
@@ -235,7 +235,7 @@
       !llvm::sys::fs::status(".", DotStatus) &&
       PWDStatus.getUniqueID() == DotStatus.getUniqueID()) {
     result.append(pwd, pwd + strlen(pwd));
-    return error_code::success();
+    return error_code();
   }
 
 #ifdef MAXPATHLEN
@@ -257,7 +257,7 @@
   }
 
   result.set_size(strlen(result.data()));
-  return error_code::success();
+  return error_code();
 }
 
 error_code create_directory(const Twine &path, bool IgnoreExisting) {
@@ -269,7 +269,7 @@
       return error_code(errno, system_category());
   }
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code normalize_separators(SmallVectorImpl<char> &Path) {
@@ -282,7 +282,7 @@
         *PI = '/';
     }
   }
-  return error_code::success();
+  return error_code();
 }
 
 // Note that we are using symbolic link because hard links are not supported by
@@ -297,7 +297,7 @@
   if (::symlink(t.begin(), f.begin()) == -1)
     return error_code(errno, system_category());
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code remove(const Twine &path, bool IgnoreNonExisting) {
@@ -308,7 +308,7 @@
   if (lstat(p.begin(), &buf) != 0) {
     if (errno != errc::no_such_file_or_directory || !IgnoreNonExisting)
       return error_code(errno, system_category());
-    return error_code::success();
+    return error_code();
   }
 
   // Note: this check catches strange situations. In all cases, LLVM should
@@ -324,7 +324,7 @@
       return error_code(errno, system_category());
   }
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code rename(const Twine &from, const Twine &to) {
@@ -337,7 +337,7 @@
   if (::rename(f.begin(), t.begin()) == -1)
     return error_code(errno, system_category());
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code resize_file(const Twine &path, uint64_t size) {
@@ -347,7 +347,7 @@
   if (::truncate(p.begin(), size) == -1)
     return error_code(errno, system_category());
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code exists(const Twine &path, bool &result) {
@@ -361,7 +361,7 @@
   } else
     result = true;
 
-  return error_code::success();
+  return error_code();
 }
 
 bool can_write(const Twine &Path) {
@@ -395,7 +395,7 @@
   if (error_code ec = status(A, fsA)) return ec;
   if (error_code ec = status(B, fsB)) return ec;
   result = equivalent(fsA, fsB);
-  return error_code::success();
+  return error_code();
 }
 
 static error_code fillStatus(int StatRet, const struct stat &Status,
@@ -429,7 +429,7 @@
       file_status(Type, Perms, Status.st_dev, Status.st_ino, Status.st_mtime,
                   Status.st_uid, Status.st_gid, Status.st_size);
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code status(const Twine &Path, file_status &Result) {
@@ -455,7 +455,7 @@
   Times[1] = Times[0];
   if (::futimens(FD, Times))
     return error_code(errno, system_category());
-  return error_code::success();
+  return error_code();
 #elif defined(HAVE_FUTIMES)
   timeval Times[2];
   Times[0].tv_sec = Time.toEpochTime();
@@ -463,7 +463,7 @@
   Times[1] = Times[0];
   if (::futimes(FD, Times))
     return error_code(errno, system_category());
-  return error_code::success();
+  return error_code();
 #else
 #warning Missing futimes() and futimens()
   return make_error_code(errc::not_supported);
@@ -497,7 +497,7 @@
   Mapping = ::mmap(nullptr, Size, prot, flags, FD, Offset);
   if (Mapping == MAP_FAILED)
     return error_code(errno, system_category());
-  return error_code::success();
+  return error_code();
 }
 
 mapped_file_region::mapped_file_region(const Twine &path,
@@ -602,7 +602,7 @@
     ::closedir(reinterpret_cast<DIR *>(it.IterationHandle));
   it.IterationHandle = 0;
   it.CurrentEntry = directory_entry();
-  return error_code::success();
+  return error_code();
 }
 
 error_code detail::directory_iterator_increment(detail::DirIterState &it) {
@@ -619,7 +619,7 @@
   } else
     return directory_iterator_destruct(it);
 
-  return error_code::success();
+  return error_code();
 }
 
 error_code get_magic(const Twine &path, uint32_t len,
@@ -650,7 +650,7 @@
   }
   std::fclose(file);
   result.set_size(size);
-  return error_code::success();
+  return error_code();
 }
 
 error_code openFileForRead(const Twine &Name, int &ResultFD) {
@@ -660,7 +660,7 @@
     if (errno != EINTR)
       return error_code(errno, system_category());
   }
-  return error_code::success();
+  return error_code();
 }
 
 error_code openFileForWrite(const Twine &Name, int &ResultFD,
@@ -690,7 +690,7 @@
     if (errno != EINTR)
       return error_code(errno, system_category());
   }
-  return error_code::success();
+  return error_code();
 }
 
 } // end namespace fs
diff --git a/llvm/lib/Support/Unix/Process.inc b/llvm/lib/Support/Unix/Process.inc
index 8faa638..d927bb5 100644
--- a/llvm/lib/Support/Unix/Process.inc
+++ b/llvm/lib/Support/Unix/Process.inc
@@ -195,7 +195,7 @@
                                       SpecificBumpPtrAllocator<char> &) {
   ArgsOut.append(ArgsIn.begin(), ArgsIn.end());
 
-  return error_code::success();
+  return error_code();
 }
 
 bool Process::StandardInIsUserInput() {