[Lldb-commits] [PATCH] D91241: [LLDB] Make offset field optional in RegisterInfo packet for Arm64

Muhammad Omair Javaid via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 30 04:36:54 PST 2020


omjavaid added a comment.

In D91241#2422517 <https://reviews.llvm.org/D91241#2422517>, @labath wrote:

> In D91241#2422403 <https://reviews.llvm.org/D91241#2422403>, @omjavaid wrote:
>
>> In D91241#2422100 <https://reviews.llvm.org/D91241#2422100>, @labath wrote:
>>
>>> Looks great. One question about the member variable...
>>
>> m_remote_to_local_regnum_map is used by AddRegister where we add a (key,value) pair for each of registers. We are doing this to maintain a list of register sorted in increasing order of remote register numbers. This list is then used in Finalize where we are calculating offsets. Keeping this map as member saves us from generating a sorted list of remote register numbers.
>
> Yes, but there's no reason that this _must_ be done in AddRegister, is there?
>
> You could just build a local map directly inside the finalize function, right?

Yes this just avoid an extra iteration over m_regs list.


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

https://reviews.llvm.org/D91241



More information about the lldb-commits mailing list