clang 22.0.0git
|
#include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Expr.h"
#include "clang/AST/PrettyPrinter.h"
#include "clang/AST/RecordLayout.h"
#include "clang/AST/Type.h"
#include "clang/Analysis/AnalysisDeclContext.h"
#include "clang/Analysis/Support/BumpVector.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/SourceManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicExtent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CheckedArithmetic.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstdint>
#include <iterator>
#include <optional>
#include <string>
#include <tuple>
#include <utility>
#include "clang/StaticAnalyzer/Core/PathSensitive/Regions.def"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "MemRegion" |
#define | REGION(Id, Parent) |
Functions | |
REGISTER_MAP_WITH_PROGRAMSTATE (MemSpacesMap, const MemRegion *, const MemSpaceRegion *) static bool isAReferenceTypedValueRegion(const MemRegion *R) | |
static llvm::PointerUnion< const StackFrameContext *, const VarRegion * > | getStackOrCaptureRegionForDeclContext (const LocationContext *LC, const DeclContext *DC, const VarDecl *VD) |
Look through a chain of LocationContexts to either find the StackFrameContext that matches a DeclContext, or find a VarRegion for a variable captured by a block. | |
static bool | isStdStreamVar (const VarDecl *D) |
static bool | isValidBaseClass (const CXXRecordDecl *BaseClass, const TypedValueRegion *Super, bool IsVirtual) |
Checks whether BaseClass is a valid virtual or direct non-virtual base class of the type of Super . | |
static bool | isImmediateBase (const CXXRecordDecl *Child, const CXXRecordDecl *Base) |
Returns true if Base is an immediate base class of Child . | |
static RegionOffset | calculateOffset (const MemRegion *R) |
#define DEBUG_TYPE "MemRegion" |
Definition at line 60 of file MemRegion.cpp.
#define REGION | ( | Id, | |
Parent ) |
|
static |
Definition at line 1553 of file MemRegion.cpp.
References clang::cast(), clang::RecordDecl::fields(), clang::ento::SVal::getAs(), clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), clang::ASTContext::getCharWidth(), clang::ento::MemRegion::getContext(), clang::ASTRecordLayout::getFieldOffset(), clang::ento::MemRegion::getKind(), clang::DeclContext::getParent(), clang::CharUnits::getQuantity(), clang::ASTContext::getTypeSize(), clang::ASTRecordLayout::getVBaseClassOffset(), clang::TagDecl::isCompleteDefinition(), isImmediateBase(), clang::Type::isIncompleteType(), clang::TagDecl::isUnion(), and clang::ento::RegionOffset::Symbolic.
Referenced by clang::ento::MemRegion::getAsOffset().
|
static |
Look through a chain of LocationContexts to either find the StackFrameContext that matches a DeclContext, or find a VarRegion for a variable captured by a block.
Definition at line 1000 of file MemRegion.cpp.
References clang::cast(), and clang::LocationContext::getParent().
Referenced by clang::ento::MemRegionManager::getVarRegion().
|
static |
Returns true if Base
is an immediate base class of Child
.
Definition at line 1539 of file MemRegion.cpp.
Referenced by calculateOffset().
Definition at line 1025 of file MemRegion.cpp.
References clang::Decl::getASTContext(), clang::QualType::getCanonicalType(), clang::Decl::getDeclContext(), clang::ASTContext::getFILEType(), clang::NamedDecl::getIdentifier(), clang::IdentifierInfo::getName(), clang::Type::getPointeeType(), clang::ValueDecl::getType(), clang::QualType::isNull(), clang::Type::isPointerType(), and clang::DeclContext::isTranslationUnit().
Referenced by clang::ento::MemRegionManager::getVarRegion().
|
static |
Checks whether BaseClass
is a valid virtual or direct non-virtual base class of the type of Super
.
Definition at line 1310 of file MemRegion.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::ento::TypedValueRegion::getValueType(), and clang::CXXRecordDecl::isVirtuallyDerivedFrom().
Referenced by clang::ento::MemRegionManager::getCXXBaseObjectRegion().
REGISTER_MAP_WITH_PROGRAMSTATE | ( | MemSpacesMap | , |
const MemRegion * | , | ||
const MemSpaceRegion * | ) const |
Definition at line 62 of file MemRegion.cpp.