PDBFPO: Refactor register reference resolution
authorPavel Labath <pavel@labath.sk>
Tue, 2 Apr 2019 08:44:24 +0000 (08:44 +0000)
committerPavel Labath <pavel@labath.sk>
Tue, 2 Apr 2019 08:44:24 +0000 (08:44 +0000)
commit1c4ee1601260d3dfc73c7c69b2f02fc4888a5e6e
treeafb4ece5a96b34fe4e29ffc52eb065184aa9093b
parentbea52e5289b9ec8b49304939c03ceac78fe6163f
PDBFPO: Refactor register reference resolution

Summary:
This refactors moves the register name->number resolution out of the
FPOProgramNodeRegisterRef class. Instead I create a special
FPOProgramNodeSymbol class, which holds unresolved symbols, and move the
resolution into the ResolveRegisterRefs visitor.

The background here is that I'd like to use this code for Breakpad
unwind info, which uses similar syntax to describe unwind info. For
example, a simple breakpad unwind program might look like:
    .cfa: $esp 8 + $ebp: .cfa 8 - ^

To be able to do this, I need to be able to customize register
resolving, as that is presently hardcoded to use codeview register
names, but breakpad supports a lot more architectures with different
register names. Moving the resolution into a separate class will allow
each user to use a different resolution logic.

Reviewers: aleksandr.urakov, zturner, amccarth

Subscribers: jdoerfert, lldb-commits

Differential Revision: https://reviews.llvm.org/D60068

llvm-svn: 357455
lldb/source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp