================
@@ -63,6 +63,11 @@ Error SpecialCaseList::Matcher::insert(StringRef Pattern, 
unsigned LineNumber,
                        .moveInto(Pair.first))
       return Err;
     Pair.second = LineNumber;
+  } else {
----------------
qinkunbao wrote:

I believe the change inside `SpecialCaseList::Matcher::insert` is needed. 
Consider the following example,
```
1 src:*
2 src:*/test1.c
3 src:*/test1.c=sanitize
4 src:*/test1.c
```
`src:*/test1.c` at line 2 and `src:*/test1.c` at line 4 shares the same 
Section, Prefix and Query and Catogory. As a result, when the previous 
implementation will skip updating the lineNo. Without the change, we can not 
know the correct line number even if we do a reverse order iteration. (I tested 
it by removing the change inside `SpecialCaseList::Matcher::insert` and walking 
Globs/Regex in reverse order. The test will fail for src.ignorelist.contradict4

> Also we need a patch to Matcher::Globs -> vector

Will change it in a new PR. 


https://github.com/llvm/llvm-project/pull/140529
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to