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

Rafael Espindola rafael.espindola at gmail.com
Fri May 30 18:26:31 PDT 2014


Author: rafael
Date: Fri May 30 20:26:30 2014
New Revision: 209949

URL: http://llvm.org/viewvc/llvm-project?rev=209949&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/Basic/VirtualFileSystem.cpp
    cfe/trunk/lib/Format/Format.cpp
    cfe/trunk/lib/Frontend/FrontendActions.cpp

Modified: cfe/trunk/lib/Basic/VirtualFileSystem.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/VirtualFileSystem.cpp?rev=209949&r1=209948&r2=209949&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/VirtualFileSystem.cpp (original)
+++ cfe/trunk/lib/Basic/VirtualFileSystem.cpp Fri May 30 20:26:30 2014
@@ -142,7 +142,7 @@ error_code RealFile::close() {
   if (::close(FD))
     return error_code(errno, system_category());
   FD = -1;
-  return error_code::success();
+  return error_code();
 }
 
 void RealFile::setName(StringRef Name) {
@@ -175,7 +175,7 @@ error_code RealFileSystem::openFileForRe
     return EC;
   Result.reset(new RealFile(FD));
   Result->setName(Name.str());
-  return error_code::success();
+  return error_code();
 }
 
 IntrusiveRefCntPtr<FileSystem> vfs::getRealFileSystem() {
@@ -829,7 +829,7 @@ error_code VFSFromYAML::openFileForRead(
   if (!F->useExternalName(UseExternalNames))
     Result->setName(Path.str());
 
-  return error_code::success();
+  return error_code();
 }
 
 IntrusiveRefCntPtr<FileSystem>

Modified: cfe/trunk/lib/Format/Format.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=209949&r1=209948&r2=209949&view=diff
==============================================================================
--- cfe/trunk/lib/Format/Format.cpp (original)
+++ cfe/trunk/lib/Format/Format.cpp Fri May 30 20:26:30 2014
@@ -482,7 +482,7 @@ llvm::error_code parseConfiguration(Stri
         Styles[i].Language == FormatStyle::LK_None) {
       *Style = Styles[i];
       Style->Language = Language;
-      return llvm::error_code::success();
+      return llvm::error_code();
     }
   }
   return llvm::make_error_code(llvm::errc::not_supported);

Modified: cfe/trunk/lib/Frontend/FrontendActions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendActions.cpp?rev=209949&r1=209948&r2=209949&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendActions.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendActions.cpp Fri May 30 20:26:30 2014
@@ -153,7 +153,7 @@ static llvm::error_code addHeaderInclude
   Includes += "\"\n";
   if (IsExternC && LangOpts.CPlusPlus)
     Includes += "}\n";
-  return llvm::error_code::success();
+  return llvm::error_code();
 }
 
 static llvm::error_code addHeaderInclude(const FileEntry *Header,
@@ -176,7 +176,7 @@ collectModuleHeaderIncludes(const LangOp
                             SmallVectorImpl<char> &Includes) {
   // Don't collect any headers for unavailable modules.
   if (!Module->isAvailable())
-    return llvm::error_code::success();
+    return llvm::error_code();
 
   // Add includes for each of these headers.
   for (unsigned I = 0, N = Module->NormalHeaders.size(); I != N; ++I) {
@@ -237,7 +237,7 @@ collectModuleHeaderIncludes(const LangOp
             LangOpts, FileMgr, ModMap, *Sub, Includes))
       return Err;
 
-  return llvm::error_code::success();
+  return llvm::error_code();
 }
 
 bool GenerateModuleAction::BeginSourceFileAction(CompilerInstance &CI, 
@@ -310,7 +310,7 @@ bool GenerateModuleAction::BeginSourceFi
 
   // Collect the set of #includes we need to build the module.
   SmallString<256> HeaderContents;
-  llvm::error_code Err = llvm::error_code::success();
+  llvm::error_code Err = llvm::error_code();
   if (const FileEntry *UmbrellaHeader = Module->getUmbrellaHeader())
     Err = addHeaderInclude(UmbrellaHeader, HeaderContents, CI.getLangOpts(),
                            Module->IsExternC);





More information about the cfe-commits mailing list