[PATCH] D55919: [DebugInfo] Omit location list entries with empty ranges

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 8 07:50:52 PST 2019


dstenb marked an inline comment as done.
dstenb added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1188
+      // variable.
+      if (DIExpr->isFragment())
+        OpenRanges.push_back(Value);
----------------
aprantl wrote:
> dstenb wrote:
> > aprantl wrote:
> > > why not just move the condition two lines further down?
> > Sorry for the late response due to the holiday season!
> > 
> > I'm not sure I follow. Do you mean to merge this code with the `DIExpr->isFragment()` code at line 1198 somehow?
> Yeah, this code block looks like it is repeated further down below and I was wondering if it could be simplified / deduplicated.
If it is okay for you, I think I prefer bailing out early like this at the cost of that code duplication, in order to avoid creating an unused `DebugLocEntry` object, and dealing with the `DebugLoc.back().MergeValues(Loc)` invocation in that conditional, as I think that might make the code a bit harder to understand.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D55919





More information about the llvm-commits mailing list