1 //===- StoreRef.h - Smart pointer for store objects -------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file defined the type StoreRef.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_STOREREF_H
14 #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_STOREREF_H
23 /// Store - This opaque type encapsulates an immutable mapping from
24 /// locations to values. At a high-level, it represents the symbolic
25 /// memory model. Different subclasses of StoreManager may choose
26 /// different types to represent the locations and values.
27 using Store = const void *;
34 StoreRef(Store store, StoreManager &smgr);
35 StoreRef(const StoreRef &sr);
36 StoreRef &operator=(StoreRef const &newStore);
39 bool operator==(const StoreRef &x) const {
40 assert(&mgr == &x.mgr);
41 return x.store == store;
44 bool operator!=(const StoreRef &x) const { return !operator==(x); }
46 Store getStore() const { return store; }
47 const StoreManager &getStoreManager() const { return mgr; }
53 #endif // LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_STOREREF_H