zequanwu added a comment.

In D116195#3207672 <https://reviews.llvm.org/D116195#3207672>, @labath wrote:

> How are you planning to make use of this functionality?
>
> I'm asking because I'm wondering if it wouldn't be better to do this kind of 
> processing in the PDB code, and then hand this class a finished list of line 
> entries. Inserting entries into the middle of a vector is expensive, which is 
> why our dwarf code no longer uses this function (it uses the 
> vector<LineSequence> constructor instead). If we could get pdb to do 
> something similar, then we could get rid of this function altogether.

My plan was to insert entries when parsing inlined call site(`S_INLINESITE `) 
in ParseBlocksRecursive, which usually happens after ParseLineTable. In PDB, 
line entries in inlined call site often have same file addresses as line 
entries in line table, and the former is better since it describes lines inside 
inlined function rather than lines in caller. And we could have nested inlined 
call sites. The line entries from inner call sites would always overwrite the 
line entries from the outer call sites if they have the same file address.

Maybe it's better to use a set to store the line entries, ordering just by the 
file address so that insertion is cheaper? Currently, it compares other fields 
if two lines have same file address 
(https://github.com/llvm/llvm-project/blob/main/lldb/source/Symbol/LineTable.cpp#L150).
 Is it necessary? I think line entries in line table always have distinct file 
address.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116195

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to