[llvm] r270950 - [Support] Rename unconvertibleErrorCode to inconvertibleErrorCode.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Thu May 26 18:54:25 PDT 2016


Author: lhames
Date: Thu May 26 20:54:25 2016
New Revision: 270950

URL: http://llvm.org/viewvc/llvm-project?rev=270950&view=rev
Log:
[Support] Rename unconvertibleErrorCode to inconvertibleErrorCode.

Based on a totally scientific, 30 second google search "in-" appears to be the
preferred prefix.


Modified:
    llvm/trunk/include/llvm/Support/Error.h
    llvm/trunk/lib/Support/Error.cpp
    llvm/trunk/unittests/Support/ErrorTest.cpp

Modified: llvm/trunk/include/llvm/Support/Error.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Error.h?rev=270950&r1=270949&r2=270950&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Error.h (original)
+++ llvm/trunk/include/llvm/Support/Error.h Thu May 26 20:54:25 2016
@@ -857,7 +857,7 @@ protected:
 /// sensible conversion to std::error_code is available, as attempts to convert
 /// to/from this error will result in a fatal error. (i.e. it is a programmatic
 ///error to try to convert such a value).
-std::error_code unconvertibleErrorCode();
+std::error_code inconvertibleErrorCode();
 
 /// Helper for converting an std::error_code to a Error.
 Error errorCodeToError(std::error_code EC);

Modified: llvm/trunk/lib/Support/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Error.cpp?rev=270950&r1=270949&r2=270950&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Error.cpp (original)
+++ llvm/trunk/lib/Support/Error.cpp Thu May 26 20:54:25 2016
@@ -20,7 +20,7 @@ namespace {
 
   enum class ErrorErrorCode : int {
     MultipleErrors = 1,
-    UnconvertibleError
+    InconvertibleError
   };
 
   // FIXME: This class is only here to support the transition to llvm::Error. It
@@ -34,8 +34,8 @@ namespace {
       switch (static_cast<ErrorErrorCode>(condition)) {
       case ErrorErrorCode::MultipleErrors:
         return "Multiple errors";
-      case ErrorErrorCode::UnconvertibleError:
-        return "Unconvertible error value. An error has occurred that could "
+      case ErrorErrorCode::InconvertibleError:
+        return "Inconvertible error value. An error has occurred that could "
                "not be converted to a known std::error_code. Please file a "
                "bug.";
       }
@@ -61,8 +61,8 @@ std::error_code ErrorList::convertToErro
                          *ErrorErrorCat);
 }
 
-std::error_code unconvertibleErrorCode() {
-  return std::error_code(static_cast<int>(ErrorErrorCode::UnconvertibleError),
+std::error_code inconvertibleErrorCode() {
+  return std::error_code(static_cast<int>(ErrorErrorCode::InconvertibleError),
                          *ErrorErrorCat);
 }
 
@@ -77,7 +77,7 @@ std::error_code errorToErrorCode(Error E
   handleAllErrors(std::move(Err), [&](const ErrorInfoBase &EI) {
     EC = EI.convertToErrorCode();
   });
-  if (EC == unconvertibleErrorCode())
+  if (EC == inconvertibleErrorCode())
     report_fatal_error(EC.message());
   return EC;
 }

Modified: llvm/trunk/unittests/Support/ErrorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ErrorTest.cpp?rev=270950&r1=270949&r2=270950&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/ErrorTest.cpp (original)
+++ llvm/trunk/unittests/Support/ErrorTest.cpp Thu May 26 20:54:25 2016
@@ -382,7 +382,7 @@ TEST(Error, StringError) {
   std::string Msg;
   raw_string_ostream S(Msg);
   logAllUnhandledErrors(make_error<StringError>("foo" + Twine(42),
-                                                unconvertibleErrorCode()),
+                                                inconvertibleErrorCode()),
                         S, "");
   EXPECT_EQ(S.str(), "foo42\n") << "Unexpected StringError log result";
 




More information about the llvm-commits mailing list