llvm/clang/lib/StaticAnalyzer/Core/SVals.cpp

//===-- SVals.cpp - Abstract RValues for Path-Sens. Value Tracking --------===//
//
// 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 SVal, Loc, and NonLoc, classes that represent
//  abstract r-values for use with path-sensitive value tracking.
//
//===----------------------------------------------------------------------===//

#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/Expr.h"
#include "clang/AST/Type.h"
#include "clang/Basic/JsonSupport.h"
#include "clang/Basic/LLVM.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SValVisitor.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SymExpr.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <optional>

usingnamespaceclang;
usingnamespaceento;

//===----------------------------------------------------------------------===//
// Symbol iteration within an SVal.
//===----------------------------------------------------------------------===//

//===----------------------------------------------------------------------===//
// Utility methods.
//===----------------------------------------------------------------------===//

const FunctionDecl *SVal::getAsFunctionDecl() const {}

/// If this SVal is a location (subclasses Loc) and wraps a symbol,
/// return that SymbolRef.  Otherwise return 0.
///
/// Implicit casts (ex: void* -> char*) can turn Symbolic region into Element
/// region. If that is the case, gets the underlining region.
/// When IncludeBaseRegions is set to true and the SubRegion is non-symbolic,
/// the first symbolic parent region is returned.
SymbolRef SVal::getAsLocSymbol(bool IncludeBaseRegions) const {}

/// Get the symbol in the SVal or its base region.
SymbolRef SVal::getLocSymbolInBase() const {}

/// If this SVal wraps a symbol return that SymbolRef.
/// Otherwise, return 0.
///
/// Casts are ignored during lookup.
/// \param IncludeBaseRegions The boolean that controls whether the search
/// should continue to the base regions if the region is not symbolic.
SymbolRef SVal::getAsSymbol(bool IncludeBaseRegions) const {}

const llvm::APSInt *SVal::getAsInteger() const {}

const MemRegion *SVal::getAsRegion() const {}

namespace {
class TypeRetrievingVisitor
    : public FullSValVisitor<TypeRetrievingVisitor, QualType> {};
} // end anonymous namespace

QualType SVal::getType(const ASTContext &Context) const {}

const MemRegion *loc::MemRegionVal::stripCasts(bool StripBaseCasts) const {}

const void *nonloc::LazyCompoundVal::getStore() const {}

const TypedValueRegion *nonloc::LazyCompoundVal::getRegion() const {}

bool nonloc::PointerToMember::isNullMemberPointer() const {}

const NamedDecl *nonloc::PointerToMember::getDecl() const {}

//===----------------------------------------------------------------------===//
// Other Iterators.
//===----------------------------------------------------------------------===//

nonloc::CompoundVal::iterator nonloc::CompoundVal::begin() const {}

nonloc::CompoundVal::iterator nonloc::CompoundVal::end() const {}

nonloc::PointerToMember::iterator nonloc::PointerToMember::begin() const {}

nonloc::PointerToMember::iterator nonloc::PointerToMember::end() const {}

//===----------------------------------------------------------------------===//
// Useful predicates.
//===----------------------------------------------------------------------===//

bool SVal::isConstant() const {}

bool SVal::isConstant(int I) const {}

bool SVal::isZeroConstant() const {}

//===----------------------------------------------------------------------===//
// Pretty-Printing.
//===----------------------------------------------------------------------===//

StringRef SVal::getKindStr() const {}

LLVM_DUMP_METHOD void SVal::dump() const {}

void SVal::printJson(raw_ostream &Out, bool AddQuotes) const {}

void SVal::dumpToStream(raw_ostream &os) const {}

void NonLoc::dumpToStream(raw_ostream &os) const {}

void Loc::dumpToStream(raw_ostream &os) const {}