[PATCH] D44382: [DWARF] Rework debug line parsing to use llvm::Error

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 12 07:55:41 PDT 2018


labath added a comment.

I am quite new to this part of llvm, so I'll just sit back and learn. I'll just say that a similar error classification would be very useful for the debug_names parser (which I am working on now, and I have noticed the inability to signal that just one of the name indexes is corrupt) and probably a lot of other debug info parsers, so I welcome this effort (though I'm not entirely sure that your usage of llvm::Error is completely idiomatic here).



================
Comment at: include/llvm/DebugInfo/DWARF/DWARFDebugLine.h:68
+/// \returns the highest severity error reported.
+DebugLineError::Severity handleDebugLineParseErrors(Error &&ParseErrors);
+
----------------
Drop the `&&`. This makes it clear that the function will clear the error (whereas previously it could just ignore them and leave the caller with an uncleared error).


================
Comment at: lib/DebugInfo/DWARF/DWARFDebugLine.cpp:42-43
+                  [&](DebugLineError &Info) {
+                    if (Info.getSeverity() == DebugLineError::None)
+                      return;
+
----------------
Why should we ever have an error with severity "none"?


Repository:
  rL LLVM

https://reviews.llvm.org/D44382





More information about the llvm-commits mailing list