[PATCH] D16093: Allow context to report errors on files linked in the resolver

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 13 15:01:50 PST 2016


lhames added a comment.

This seems generically useful, but Is there a test case or use case?


================
Comment at: include/lld/Core/Resolver.h:53
@@ -51,3 +52,3 @@
   // Handle a shared library file.
-  void handleSharedLibrary(File &);
+  ErrorOr<bool> handleSharedLibrary(File &);
 
----------------
handleSharedLibrary doesn't add any undefined symbols, so this can remain 'void'.

================
Comment at: lib/Core/Resolver.cpp:113
@@ +112,3 @@
+  auto undefAddedOrError = handleFile(*sharedLibrary);
+  if (undefAddedOrError.getError())
+    return undefAddedOrError;
----------------
I think that it's reasonable to just assert that there was no error or undef added here.

================
Comment at: lib/Core/Resolver.cpp:126
@@ +125,3 @@
+
+  if (undefAddedOrError.getError())
+    return undefAddedOrError;
----------------
Ditto here - we should just be able to assert no error here.


http://reviews.llvm.org/D16093





More information about the llvm-commits mailing list