[clang-tools-extra] r209953 - Use error_code() instead of error_code::succes()

Rafael Espindola rafael.espindola at gmail.com
Fri May 30 19:01:00 PDT 2014


Author: rafael
Date: Fri May 30 21:00:59 2014
New Revision: 209953

URL: http://llvm.org/viewvc/llvm-project?rev=209953&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:
    clang-tools-extra/trunk/clang-modernize/Core/IncludeExcludeInfo.cpp
    clang-tools-extra/trunk/modularize/Modularize.cpp
    clang-tools-extra/trunk/unittests/clang-modernize/IncludeExcludeTest.cpp

Modified: clang-tools-extra/trunk/clang-modernize/Core/IncludeExcludeInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-modernize/Core/IncludeExcludeInfo.cpp?rev=209953&r1=209952&r2=209953&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-modernize/Core/IncludeExcludeInfo.cpp (original)
+++ clang-tools-extra/trunk/clang-modernize/Core/IncludeExcludeInfo.cpp Fri May 30 21:00:59 2014
@@ -103,7 +103,7 @@ error_code parseCLInput(StringRef Line,
 
     llvm::errs() << "Parse: " <<List.back() << "\n";
   }
-  return error_code::success();
+  return error_code();
 }
 } // end anonymous namespace
 
@@ -115,7 +115,7 @@ error_code IncludeExcludeInfo::readListF
   if (error_code Err = parseCLInput(ExcludeString, ExcludeList,
                                     /*Separator=*/ ","))
     return Err;
-  return error_code::success();
+  return error_code();
 }
 
 error_code IncludeExcludeInfo::readListFromFile(StringRef IncludeListFile,
@@ -140,7 +140,7 @@ error_code IncludeExcludeInfo::readListF
                                       /*Separator=*/ "\n"))
       return Err;
   }
-  return error_code::success();
+  return error_code();
 }
 
 bool IncludeExcludeInfo::isFileIncluded(StringRef FilePath) const {

Modified: clang-tools-extra/trunk/modularize/Modularize.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/modularize/Modularize.cpp?rev=209953&r1=209952&r2=209953&view=diff
==============================================================================
--- clang-tools-extra/trunk/modularize/Modularize.cpp (original)
+++ clang-tools-extra/trunk/modularize/Modularize.cpp Fri May 30 21:00:59 2014
@@ -284,7 +284,7 @@ error_code getHeaderFileNames(SmallVecto
     Dependencies[HeaderFileName.str()] = Dependents;
   }
 
-  return error_code::success();
+  return error_code();
 }
 
 // Helper function for finding the input file in an arguments list.

Modified: clang-tools-extra/trunk/unittests/clang-modernize/IncludeExcludeTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-modernize/IncludeExcludeTest.cpp?rev=209953&r1=209952&r2=209953&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-modernize/IncludeExcludeTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-modernize/IncludeExcludeTest.cpp Fri May 30 21:00:59 2014
@@ -20,7 +20,7 @@ TEST(IncludeExcludeTest, ParseString) {
       /*include=*/ "a,b/b2,c/c2,d/../d2/../d3",
       /*exclude=*/ "a/af.cpp,a/a2,b/b2/b2f.cpp,c/c2");
 
-  ASSERT_EQ(Err, llvm::error_code::success());
+  ASSERT_EQ(Err, llvm::error_code());
 
   // If the file does not appear on the include list then it is not safe to
   // transform. Files are not safe to transform by default.
@@ -65,7 +65,7 @@ TEST(IncludeExcludeTest, ParseStringCase
       /*include=*/  "a/.,b/b2/,c/c2/c3/../../c4/,d/d2/./d3/,/e/e2/.",
       /*exclude=*/ "");
 
-  ASSERT_EQ(Err, llvm::error_code::success());
+  ASSERT_EQ(Err, llvm::error_code());
 
   EXPECT_TRUE(IEManager.isFileIncluded("a/f.cpp"));
   EXPECT_TRUE(IEManager.isFileIncluded("b/b2/f.cpp"));
@@ -126,7 +126,7 @@ TEST(IncludeExcludeFileTest, UNIXFile) {
   llvm::error_code Err = IEManager.readListFromFile(
       UnixFiles.IncludeDataPath.c_str(), UnixFiles.ExcludeDataPath.c_str());
 
-  ASSERT_EQ(Err, llvm::error_code::success());
+  ASSERT_EQ(Err, llvm::error_code());
 
   EXPECT_FALSE(IEManager.isFileIncluded("f.cpp"));
   EXPECT_TRUE(IEManager.isFileIncluded("a/f.cpp"));
@@ -141,7 +141,7 @@ TEST(IncludeExcludeFileTest, DOSFile) {
   llvm::error_code Err = IEManager.readListFromFile(
       DOSFiles.IncludeDataPath.c_str(), DOSFiles.ExcludeDataPath.c_str());
 
-  ASSERT_EQ(Err, llvm::error_code::success());
+  ASSERT_EQ(Err, llvm::error_code());
 
   EXPECT_FALSE(IEManager.isFileIncluded("f.cpp"));
   EXPECT_TRUE(IEManager.isFileIncluded("a/f.cpp"));





More information about the cfe-commits mailing list