ASDenysPetrov added a comment. @vsavchenko FYI.
================ Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:112-113 +RangeSet RangeSet::Factory::add(RangeSet LHS, RangeSet RHS) { + if (LHS.isEmpty()) + return RHS; + for (const Range &R : RHS) ---------------- Also optimized this particular case. ================ Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:138-139 - return makePersistent(std::move(Result)); -} + if (!Original.pin(From, To)) + return getEmptySet(); ---------------- This allows to add a RangeSet of any type. E.g. RangeSet(uchar) + RangeSet(int) = valid, because of `pin` I'm wondering whether we really need it here in practice? ================ Comment at: clang/unittests/StaticAnalyzer/RangeSetTest.cpp:166 RawRangeSet RawExpected) { - wrap(&Self::checkAddImpl<RangeSet>, RawRHS, RawLHS, RawExpected); + wrap(&Self::checkAddImpl<RangeSet>, RawLHS, RawRHS, RawExpected); } ---------------- Fixed the misprint. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99797/new/ https://reviews.llvm.org/D99797 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits