[llvm-branch-commits] Fix the tests that have multiple same entry. (PR #140751)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue May 20 08:52:13 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-support
Author: Qinkun Bao (qinkunbao)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/140751.diff
1 Files Affected:
- (modified) llvm/lib/Support/SpecialCaseList.cpp (+5)
``````````diff
diff --git a/llvm/lib/Support/SpecialCaseList.cpp b/llvm/lib/Support/SpecialCaseList.cpp
index dddf84cbb1ced..5145cccc91e3b 100644
--- a/llvm/lib/Support/SpecialCaseList.cpp
+++ b/llvm/lib/Support/SpecialCaseList.cpp
@@ -63,6 +63,11 @@ Error SpecialCaseList::Matcher::insert(StringRef Pattern, unsigned LineNumber,
.moveInto(Pair.first))
return Err;
Pair.second = LineNumber;
+ } else {
+ // We should update the new line number if an entry with the same pattern
+ // repeats.
+ auto &Pair = It->getValue();
+ Pair.second = LineNumber;
}
return Error::success();
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/140751
More information about the llvm-branch-commits
mailing list