[lld] r264982 - Remove unused variants of make_dynamic_error_code. NFC.

Pete Cooper via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 18:21:51 PDT 2016


Author: pete
Date: Wed Mar 30 20:21:50 2016
New Revision: 264982

URL: http://llvm.org/viewvc/llvm-project?rev=264982&view=rev
Log:
Remove unused variants of make_dynamic_error_code.  NFC.

make_dynamic_error_code was used to create a std::error_code with
a std::string message.  Now that we are migrating to llvm::Error,
there are no calls to these make_dynamic_error_code methods.

There is one single call to make_dynamic_error_code remaining, the one
inside GenericError::convertToErrorCode().  That method is only called
from File::doParse() which should be a temporary situation.  We need
to work out how to deal with File::parse() caching the error result from
doParse().  Caching errors isn't supported in the new scheme, and probably
isn't needed here, but we need to work that out.

Once thats done, dynamic error and all utilities around it can be deleted.

Modified:
    lld/trunk/include/lld/Core/Error.h
    lld/trunk/lib/Core/Error.cpp

Modified: lld/trunk/include/lld/Core/Error.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/Error.h?rev=264982&r1=264981&r2=264982&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/Error.h (original)
+++ lld/trunk/include/lld/Core/Error.h Wed Mar 30 20:21:50 2016
@@ -38,9 +38,7 @@ inline std::error_code make_error_code(Y
 /// supplied error string.
 /// Note:  Once ErrorOr<> is updated to work with errors other than error_code,
 /// this can be updated to return some other kind of error.
-std::error_code make_dynamic_error_code(const char *msg);
 std::error_code make_dynamic_error_code(StringRef msg);
-std::error_code make_dynamic_error_code(const Twine &msg);
 
 /// Generic error.
 ///
@@ -54,7 +52,7 @@ public:
   void log(llvm::raw_ostream &OS) const override;
 
   std::error_code convertToErrorCode() const override {
-    return make_dynamic_error_code(StringRef(getMessage()));
+    return make_dynamic_error_code(getMessage());
   }
 
 private:

Modified: lld/trunk/lib/Core/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/Error.cpp?rev=264982&r1=264981&r2=264982&view=diff
==============================================================================
--- lld/trunk/lib/Core/Error.cpp (original)
+++ lld/trunk/lib/Core/Error.cpp Wed Mar 30 20:21:50 2016
@@ -76,18 +76,10 @@ private:
 
 static dynamic_error_category categorySingleton;
 
-std::error_code make_dynamic_error_code(const char *msg) {
-  return make_dynamic_error_code(StringRef(msg));
-}
-
 std::error_code make_dynamic_error_code(StringRef msg) {
   return std::error_code(categorySingleton.add(msg), categorySingleton);
 }
 
-std::error_code make_dynamic_error_code(const Twine &msg) {
-  return std::error_code(categorySingleton.add(msg.str()), categorySingleton);
-}
-
 char GenericError::ID = 0;
 
 GenericError::GenericError(Twine Msg) : Msg(Msg.str()) { }




More information about the llvm-commits mailing list