[clang] [analyzer][NFC] Introduce APSIntPtr, a safe wrapper of APSInt (1/4) (PR #120435)
Balazs Benics via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 19 02:02:59 PST 2024
================
@@ -165,79 +166,70 @@ class BasicValueFactory {
/// Convert - Create a new persistent APSInt with the same value as 'From'
/// but with the bitwidth and signedness of 'To'.
- const llvm::APSInt &Convert(const llvm::APSInt& To,
- const llvm::APSInt& From) {
+ APSIntPtr Convert(const llvm::APSInt &To, const llvm::APSInt &From) {
APSIntType TargetType(To);
if (TargetType == APSIntType(From))
- return From;
+ return APSIntPtr(&From);
----------------
steakhal wrote:
Makes sense. I'm opting for the safe API, and I'll just call `getValue()`.
https://github.com/llvm/llvm-project/pull/120435
More information about the cfe-commits
mailing list