(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.
We can add new subdirectory here as:
add_subdirectory(LiveDebugValues)
and then, add another CMakeLists.txt with in LiveDebugValues/ and play with all of this within that CMake file locally? wdyt?