[PATCH] [lld][Driver] Replace Target with TargetInfo. Simplify LinkerInput.

Michael Spencer bigcheesegs at gmail.com
Tue Feb 5 22:57:59 PST 2013



================
Comment at: include/lld/ReaderWriter/MachOTargetInfo.h:33-39
@@ -30,1 +32,9 @@
 
+  virtual ErrorOr<Reader &> getReader(const LinkerInput &input) const {
+    llvm_unreachable("Unimplemented!");
+  }
+
+  virtual ErrorOr<Writer &> getWriter() const {
+    llvm_unreachable("Unimplemented!");
+  }
+
----------------
Shankar Kalpathi Easwaran wrote:
> These should be changed to an error code instead of llvm_unreachable.
This isn't a recoverable or diagnosable error. When this is encountered it's better to know the exactly location that stuff needs to be fixed.

================
Comment at: lib/Driver/LinkerInvocation.cpp:24-27
@@ -23,1 +23,6 @@
 
+namespace {
+std::unique_ptr<TargetInfo> createTargetInfo(const LinkerOptions &lo) {
+  return ELFTargetInfo::create(lo);
+}
+}
----------------
Shankar Kalpathi Easwaran wrote:
> Why is it hardcoded to create ELFTargetInfo ?
Because that's the only thing setup for this currently.

================
Comment at: tools/lld-core/lld-core.cpp:199-205
@@ +198,9 @@
+
+  virtual ErrorOr<Reader &> getReader(const LinkerInput &input) const {
+    llvm_unreachable("Unimplemented!");
+  }
+
+  virtual ErrorOr<Writer &> getWriter() const {
+    llvm_unreachable("Unimplemented!");
+  }
+
----------------
Shankar Kalpathi Easwaran wrote:
> Isnt this supposed to use ReaderYAML/WriterYAML ?
lld-core doesn't use these functions. It has a totally different way of selecting the reader and writer.

================
Comment at: tools/lld-core/lld-core.cpp:301-306
@@ -291,8 +300,8 @@
       break;
     case readerELF:
       reader = createReaderELF(*eti,
       [&] (const LinkerInput &) -> ErrorOr<Reader&> {
         return *reader;
       });
       break;
     default:
----------------
Shankar Kalpathi Easwaran wrote:
> Why are these references still there ?
See above.


http://llvm-reviews.chandlerc.com/D372



More information about the llvm-commits mailing list