[PATCH] D83046: [LiveDebugValues] 1/4 Install an implementation-picking LiveDebugValues pass

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 2 06:57:46 PDT 2020


jmorse created this revision.
jmorse added reviewers: aprantl, vsk, probinson, Orlando, StephenTozer, TWeaver, djtodoro.
Herald added subscribers: llvm-commits, hiraditya, mgorny.
Herald added a project: LLVM.
jmorse added a child revision: D83047: [LiveDebugValues] 2/4 Add instruction-referencing LiveDebugValues implementation.

(Context: this thread http://lists.llvm.org/pipermail/llvm-dev/2020-June/142368.html )

This patch series is preceeded by:

  mkdir llvm/lib/CodeGen/LiveDebugValues
  git mv llvm/lib/CodeGen/LiveDebugValues.cpp llvm/lib/CodeGen/VarLocBasedImpl.cpp

Plus moving the source file in CMakeLists.txt. I've assumed that such a file movement doesn't need reviewing; I can upload a review if anyone wants a closer look though.

This patch renames the current LiveDebugValues class to "InstrRefBasedLDV" and removes the pass-registration code from it. It creates a separate LiveDebugValues class that deals with pass registration and management, that calls through to InstrRefBasedLDV::ExtendRanges when runOnMachineFunction is called. This is done through the "LDVImpl" abstract class, so that a future patch can install the new instruction-referencing LiveDebugValues implementation and have it picked at runtime.

I'm not fixed to any particular symbol name in this, very happy to receive feedback on naming. I'm also aware of the "favour composition over inheritance" principle, but I believe this situation is exactly what abstract base classes (LDVImpl) are for.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83046

Files:
  llvm/lib/CodeGen/CMakeLists.txt
  llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
  llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.h
  llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83046.275087.patch
Type: text/x-patch
Size: 22423 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200702/b6f51315/attachment-0001.bin>


More information about the llvm-commits mailing list