[clang] [clang][analyzer] Stabilize path-constraint order by using alloc IDs (PR #121347)
Arseniy Zaostrovnykh via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 2 08:19:39 PST 2025
================
@@ -401,7 +401,22 @@ class RangeSet {
friend class Factory;
};
-using ConstraintMap = llvm::ImmutableMap<SymbolRef, RangeSet>;
+struct ConstraintKVInfo : llvm::ImutKeyValueInfo<SymbolRef, RangeSet> {
+ static inline bool isEqual(key_type_ref L, key_type_ref R) {
+ return L->getAllocID() == R->getAllocID();
+ }
+
+ static inline bool isLess(key_type_ref L, key_type_ref R) {
+ return L->getAllocID() < R->getAllocID();
+ }
+
+ static inline void Profile(llvm::FoldingSetNodeID &ID, value_type_ref V) {
+ ID.AddInteger(V.first->getAllocID());
+ ID.Add(V.second);
+ }
+};
+
+using ConstraintMap = llvm::ImmutableMap<SymbolRef, RangeSet, ConstraintKVInfo>;
----------------
necto wrote:
I think it should. I am preparing a superceeding PR with this ordering applied universally, as `ImutContainerInfo` specialization, and with AllocID merged with SymbolID. I'll open it here once I have evaluation results
https://github.com/llvm/llvm-project/pull/121347
More information about the cfe-commits
mailing list