[PATCH] D66656: [DebugInfo][NFCI] Refactor LiveDebugValues containers to be pass fields

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 23 08:12:53 PDT 2019


jmorse created this revision.
jmorse added reviewers: aprantl, vsk, wolfgangp.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
jmorse added a parent revision: D66599: [DebugInfo] Remove invalidated locations during LiveDebugValues.

LiveDebugValues currently declares a bunch of containers to hold state about the functions being processed, and then passes references to them through several layers of method calls. IMHO, it's simpler to place these containers in the pass object, where we then won't have to repeatedly pass them around, reducing the amount one has to read.

This separates the state of the analysis into fields of the pass object, and keeps "what we're operating on right now" as method arguments. IMHO, this more clearly communicates what a method is doing.

It's possible there's some style / convention to do this that I'm not aware of, in which case, never mind.

There's some slight flakeyness with the VarLocMap being cleared: calling "reset" on the object leads to a compile error, because UniqueVector calls std::vector::resize(0, 0), a method that does not exist in the STL. I've steered clear of dealing with this, and just overwrite VarLocIDs with a newly constructed object.


Repository:
  rL LLVM

https://reviews.llvm.org/D66656

Files:
  lib/CodeGen/LiveDebugValues.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66656.216850.patch
Type: text/x-patch
Size: 21143 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190823/6763fee4/attachment.bin>


More information about the llvm-commits mailing list