================
@@ -171,6 +171,15 @@ class SMTConstraintManager : public
clang::ento::SimpleConstraintManager {
return BVF.Convert(SC->getType(), *Value).get();
}
+ if (const UnarySymExpr *USE = dyn_cast<UnarySymExpr>(Sym)) {
+ SymbolRef Operand = USE->getOperand();
+ const llvm::APSInt *Value;
+ if (!(Value = getSymVal(State, Operand)))
+ return nullptr;
+ std::optional<APSIntPtr> Res = BVF.evalAPSInt(USE->getOpcode(), *Value);
+ return Res ? Res.value().get() : nullptr;
----------------
steakhal wrote:
Doesn't the `std::optional` have a `value_or` method? IMO that should be used
instead.
https://github.com/llvm/llvm-project/pull/205078
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits