[PATCH] D44562: [ELF] Rework debug line parsing to use llvm::Error and callbacks (LLD-side)

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 19 02:49:22 PDT 2018


grimar added inline comments.


================
Comment at: ELF/InputFiles.cpp:128
+    // for compilation unit (CU) of interest. We have only one
+    // CU (object file), so offset is always 0.
+    Expected<const DWARFDebugLine::LineTable *> ErrOrLineTable =
----------------
I would move this comment above `isValidOffset(0)` and update it as you are
doing something with offset 0 right there already.


================
Comment at: ELF/InputFiles.cpp:136
+                      [&](DebugLineError &Err) { warn(Err.message()); },
+                      [&](ErrorInfoBase &Err) { error(Err.message()); });
+  }
----------------
Is it useful to `warn` here? I think we only call this method on linkage error,
so anyways going to terminate the link.
With that, it seems easier to always error out here to simplify code/logic.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D44562





More information about the llvm-commits mailing list