[PATCH] D81220: [DWARFYAML][debug_ranges] Make the "Offset" field optional.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 5 02:42:44 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/lib/ObjectYAML/DWARFEmitter.cpp:122-124
+      assert(*DebugRanges.Offset >= CurrOffset &&
+             "Offset should be greater than or equal to the bytes that we have "
+             "written");
----------------
Higuoxing wrote:
> jhenderson wrote:
> > I don't think this wants to be an assert - it should be an error, right? If you specify a lower offset than the current position (e.g. 0 for the second set), you want an error since you can't place it there.
> Yes, I think it should be an error as well. Currently, DWARFYAML doesn't support error handling. If we change one `void EmitXXXSection()` to `Error EmitXXXSection()`, we should change them all. Can I do it in a follow-up patch?
Oh, I missed that there's an assertion in this area already. Yes, leaving it to a follow-up is fine, but please add a FIXME note in this patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81220/new/

https://reviews.llvm.org/D81220





More information about the llvm-commits mailing list