[lld] r191058 - Handle "file not found" error in the superclass's errStr().

Rui Ueyama ruiu at google.com
Thu Sep 19 17:32:41 PDT 2013


Author: ruiu
Date: Thu Sep 19 19:32:40 2013
New Revision: 191058

URL: http://llvm.org/viewvc/llvm-project?rev=191058&view=rev
Log:
Handle "file not found" error in the superclass's errStr().

If a subclass does not override the member function, the superclass's method
takes care of string conversion of "file not found" error. This is a reasonable
default behavior. Subclasses are still able to override to customize error
messages.

Modified:
    lld/trunk/include/lld/Driver/InputGraph.h

Modified: lld/trunk/include/lld/Driver/InputGraph.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Driver/InputGraph.h?rev=191058&r1=191057&r2=191058&view=diff
==============================================================================
--- lld/trunk/include/lld/Driver/InputGraph.h (original)
+++ lld/trunk/include/lld/Driver/InputGraph.h Thu Sep 19 19:32:40 2013
@@ -226,7 +226,9 @@ public:
   }
 
   /// \brief create an error string for printing purposes
-  virtual std::string errStr(llvm::error_code) {
+  virtual std::string errStr(llvm::error_code errc) {
+    if (errc == llvm::errc::no_such_file_or_directory)
+      return (Twine("Cannot open ") + _path).str();
     llvm_unreachable("not handling errors");
   }
 





More information about the llvm-commits mailing list