[PATCH] D49964: [DWARF] Refactor DWARF classes to use unified error reporting. NFC.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 20 02:00:24 PDT 2018


jhenderson accepted this revision.
jhenderson added a comment.

LGTM, from my point of view now.



================
Comment at: include/llvm/DebugInfo/DWARF/DWARFListTable.h:226
+  return createStringError(errc::invalid_argument,
+                     "no end of list marker detected at end of %s table "
                      "starting at offset 0x%" PRIx32,
----------------
This is probably another good place `illegal_byte_sequence` error.


================
Comment at: lib/DebugInfo/DWARF/DWARFContext.cpp:1583
   if (!TargetLookupError.empty())
-    return make_error<StringError>(TargetLookupError, inconvertibleErrorCode());
+    return createStringError(inconvertibleErrorCode(),
+                             TargetLookupError.c_str());
----------------
vleschuk wrote:
> jhenderson wrote:
> > This should be invalid_argument, looking at the lookupTarget function (which actually should just return an Error itself rather than setting a string...)
> > looking at the lookupTarget function (which actually should just return an Error itself rather than setting a string...)
> 
> However return result of lookupTarget is used below. Changing its behavior is not related to this change... Setting invalid_argument.
Sorry, yeah, I meant an `Expected`. But no need to change that in this change.


https://reviews.llvm.org/D49964





More information about the llvm-commits mailing list