It seems like that line entries in line table are assumed to always have
distinct file address. This allows overwriting the existing line entry if the
given file address is same as existing one.
The reason for the patch is that line table in PDB doesn't have line entries for
inlined functions. We can only get line info for inlined functions via parsing
inlined call site debug info (S_INLINESITE). This allows us to insert line
entries when we parsing S_INLINESITE, which could have line with the same
starting file address. For example:
$ llvm-pdbutil dump --symbols -l --modi=0 a.pdb Lines ============================================================ 0001:00000000-00000031, line/addr entries = 3 19 00000000 ! 20 00000004 ! 21 00000024 ! Symbols ============================================================ ... 312 | S_INLINESITE [size = 28] inlinee = 0x17E0 (foo), parent = 88, end = 432 0B44 code 0x4 (+0x4) line 2 (+2) 0B26 code 0xA (+0x6) line 3 (+1) 0B4A code 0x14 (+0xA) line 5 (+2) 0410 code end 0x24 (+0x10) 0B37 code 0x2B (+0x7) line 4 (-1) 0406 code end 0x31 (+0x6) ...
From line table, we only know 0x4 - 0x23 maps to line 20. When parsing
S_INLINESITE, we would know 0x4 - 0x9 maps to function foo declaration line + 2.
*pos = entry ?