//===- SymbolManager.h - Management of Symbolic Values ----------*- 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 // //===----------------------------------------------------------------------===// // // This file defines SymbolManager, a class that manages symbolic values // created for use by ExprEngine and related classes. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_SYMBOLMANAGER_H #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_SYMBOLMANAGER_H #include "clang/AST/Expr.h" #include "clang/AST/Type.h" #include "clang/Analysis/AnalysisDeclContext.h" #include "clang/Basic/LLVM.h" #include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h" #include "clang/StaticAnalyzer/Core/PathSensitive/StoreRef.h" #include "clang/StaticAnalyzer/Core/PathSensitive/SymExpr.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/iterator_range.h" #include "llvm/Support/Allocator.h" #include <cassert> namespace clang { class ASTContext; class Stmt; namespace ento { class BasicValueFactory; class StoreManager; ///A symbol representing the value stored at a MemRegion. class SymbolRegionValue : public SymbolData { … }; /// A symbol representing the result of an expression in the case when we do /// not know anything about what the expression is. class SymbolConjured : public SymbolData { … }; /// A symbol representing the value of a MemRegion whose parent region has /// symbolic value. class SymbolDerived : public SymbolData { … }; /// SymbolExtent - Represents the extent (size in bytes) of a bounded region. /// Clients should not ask the SymbolManager for a region's extent. Always use /// SubRegion::getExtent instead -- the value returned may not be a symbol. class SymbolExtent : public SymbolData { … }; /// SymbolMetadata - Represents path-dependent metadata about a specific region. /// Metadata symbols remain live as long as they are marked as in use before /// dead-symbol sweeping AND their associated regions are still alive. /// Intended for use by checkers. class SymbolMetadata : public SymbolData { … }; /// Represents a cast expression. class SymbolCast : public SymExpr { … }; /// Represents a symbolic expression involving a unary operator. class UnarySymExpr : public SymExpr { … }; /// Represents a symbolic expression involving a binary operator class BinarySymExpr : public SymExpr { … }; /// Template implementation for all binary symbolic expressions template <class LHSTYPE, class RHSTYPE, SymExpr::Kind ClassKind> class BinarySymExprImpl : public BinarySymExpr { … }; /// Represents a symbolic expression like 'x' + 3. SymIntExpr; /// Represents a symbolic expression like 3 - 'x'. IntSymExpr; /// Represents a symbolic expression like 'x' + 'y'. SymSymExpr; class SymbolManager { … }; /// A class responsible for cleaning up unused symbols. class SymbolReaper { … }; class SymbolVisitor { … }; } // namespace ento } // namespace clang #endif // LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_SYMBOLMANAGER_H