================
@@ -2883,22 +2883,16 @@ const llvm::APSInt 
*RangeConstraintManager::getSymVal(ProgramStateRef St,
 
 const llvm::APSInt *RangeConstraintManager::getSymMinVal(ProgramStateRef St,
                                                          SymbolRef Sym) const {
-  // TODO: Use `getRange()` like in `getSymVal()`, but that would make some
-  // of the reports of `BitwiseShiftChecker` look awkward.
-  const RangeSet *T = getConstraint(St, Sym);
-  if (!T || T->isEmpty())
-    return nullptr;
-  return &T->getMinValue();
+  auto &MutableSelf = const_cast<RangeConstraintManager &>(*this);
+  RangeSet Range = MutableSelf.getRange(St, Sym);
+  return Range.isEmpty() ? nullptr : &Range.getMinValue();
 }
 
 const llvm::APSInt *RangeConstraintManager::getSymMaxVal(ProgramStateRef St,
                                                          SymbolRef Sym) const {
-  // TODO: Use `getRange()` like in `getSymVal()`, but that would make some
-  // of the reports of `BitwiseShiftChecker` look awkward.
-  const RangeSet *T = getConstraint(St, Sym);
-  if (!T || T->isEmpty())
-    return nullptr;
-  return &T->getMaxValue();
+  auto &MutableSelf = const_cast<RangeConstraintManager &>(*this);
+  RangeSet Range = MutableSelf.getRange(St, Sym);
----------------
steakhal wrote:

The cleanup will follow in https://github.com/llvm/llvm-project/pull/112891

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

Reply via email to