================ @@ -0,0 +1,64 @@ +//== APSIntPtr.h - Wrapper for APSInt objects owned separately -*- C++ -*--==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_APSIntPtr_H +#define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_APSIntPtr_H + +#include "llvm/ADT/APSInt.h" + +namespace clang::ento { +class BasicValueFactory; + +/// A safe wrapper around APSInt objects allocated and owned by +/// \c BasicValueFactory. This just wraps a common llvm::APSInt. +class APSIntPtr { + using APSInt = llvm::APSInt; + +public: + APSIntPtr() = delete; + APSIntPtr(const APSIntPtr &) = default; + APSIntPtr &operator=(const APSIntPtr &) & = default; + ~APSIntPtr() = default; + + /// You should not use this API. + /// If do, ensure that the \p Ptr not going to dangle. + /// Prefer using \c BasicValueFactory::getValue() to get an APSIntPtr object. ---------------- Xazax-hun wrote:
Ah, it is already a friend. Never mind. https://github.com/llvm/llvm-project/pull/120435 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits