[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 00:31:10 PST 2025


================
@@ -427,8 +434,8 @@ class BinarySymExprImpl : public BinarySymExpr {
 
 public:
   BinarySymExprImpl(LHSTYPE lhs, BinaryOperator::Opcode op, RHSTYPE rhs,
-                    QualType t)
-      : BinarySymExpr(ClassKind, op, t), LHS(lhs), RHS(rhs) {
+                    QualType t, AllocIDType AllocID)
+      : BinarySymExpr(ClassKind, op, t, AllocID), LHS(lhs), RHS(rhs) {
----------------
necto wrote:

The reason is the same as for `SymbolData::Sym` that it also a unique single integer identifying a `SymbolData`: it is not available until you allocate the symbol. The only use of `SymExpr::Profile` I observed is for `SymbolManager` to avoid reallocating identical SymExprs, for which it keeps track of all SymExprs allocated and allocates a new one only when necessary. But for that it needs to identify identical SymExprs before they are allocated.

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


More information about the cfe-commits mailing list