[llvm-branch-commits] [llvm] [NFCI] Avoid adding duplicated SpecialCaseList::Sections. (PR #140821)

Qinkun Bao via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu May 22 11:59:19 PDT 2025


qinkunbao wrote:

> Make Glob a vector added in parsing order

Yeah, that is needed.

> Make sections a vector added in parsing order

It is not necessary.

> duplicate entries is not a problem as they should not be common
It is not common but we need to iterate all the sections every time to ensure the correctness. 

```
[sec1]
src:a.txt
src:b.txt
[sec1]
src:b.txt
[sec1]
src:b.txt
```
Suppose we have the function query `inSectionBlame(Section="sec1", Prefix="src", Query="a.txt", we need to iterate all sections to find the entry and get the correct line number `2`. 




https://github.com/llvm/llvm-project/pull/140821


More information about the llvm-branch-commits mailing list