clang
17.0.0git
|
#include "Move.h"
#include "SmartPtr.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/Type.h"
#include "clang/Basic/LLVM.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SymExpr.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/ErrorHandling.h"
#include <optional>
#include <string>
Go to the source code of this file.
Namespaces | |
clang | |
clang::ento | |
clang::ento::smartptr | |
Functions | |
static bool | hasStdClassWithName (const CXXRecordDecl *RD, ArrayRef< llvm::StringLiteral > Names) |
static bool | isStdSmartPtr (const CXXRecordDecl *RD) |
static bool | isStdSmartPtr (const Expr *E) |
bool | clang::ento::smartptr::isStdSmartPtrCall (const CallEvent &Call) |
Returns true if the event call is on smart pointer. More... | |
bool | clang::ento::smartptr::isStdSmartPtr (const CXXRecordDecl *RD) |
bool | clang::ento::smartptr::isStdSmartPtr (const Expr *E) |
bool | clang::ento::smartptr::isNullSmartPtr (const ProgramStateRef State, const MemRegion *ThisRegion) |
Returns whether the smart pointer is null or not. More... | |
static TrackedRegionMapTy | removeTrackedSubregions (TrackedRegionMapTy RegionMap, TrackedRegionMapTy::Factory &RegionMapFactory, const MemRegion *Region) |
static ProgramStateRef | updateSwappedRegion (ProgramStateRef State, const MemRegion *Region, const SVal *RegionInnerPointerVal) |
static QualType | getInnerPointerType (CheckerContext C, const CXXRecordDecl *RD) |
static QualType | getPointerTypeFromTemplateArg (const CallEvent &Call, CheckerContext &C) |
static QualType | getInnerPointerType (const CallEvent &Call, CheckerContext &C) |
static void | checkAndPrettyPrintRegion (llvm::raw_ostream &OS, const MemRegion *Region) |
bool | isStdBasicOstream (const Expr *E) |
static bool | isStdFunctionCall (const CallEvent &Call) |
bool | isStdOstreamOperatorCall (const CallEvent &Call) |
static bool | isPotentiallyComparisionOpCall (const CallEvent &Call) |
Variables | |
constexpr llvm::StringLiteral | STD_PTR_NAMES [] |
constexpr llvm::StringLiteral | BASIC_OSTREAM_NAMES [] = {"basic_ostream"} |
|
static |
Definition at line 225 of file SmartPtrModeling.cpp.
|
static |
Definition at line 183 of file SmartPtrModeling.cpp.
References clang::Decl::isInStdNamespace().
Referenced by getInnerPointerType().
|
static |
Definition at line 215 of file SmartPtrModeling.cpp.
References getInnerPointerType(), and clang::DeclContext::getParent().
|
static |
Definition at line 201 of file SmartPtrModeling.cpp.
|
static |
Definition at line 103 of file SmartPtrModeling.cpp.
Referenced by isStdBasicOstream(), and isStdSmartPtr().
|
static |
Definition at line 269 of file SmartPtrModeling.cpp.
References isStdFunctionCall(), and clang::ento::smartptr::isStdSmartPtr().
Definition at line 244 of file SmartPtrModeling.cpp.
References BASIC_OSTREAM_NAMES, clang::Type::getAsCXXRecordDecl(), clang::Expr::getType(), and hasStdClassWithName().
Referenced by isStdOstreamOperatorCall().
|
static |
Definition at line 249 of file SmartPtrModeling.cpp.
Referenced by isPotentiallyComparisionOpCall(), and isStdOstreamOperatorCall().
bool isStdOstreamOperatorCall | ( | const CallEvent & | Call | ) |
Definition at line 253 of file SmartPtrModeling.cpp.
References clang::FunctionDecl::getOverloadedOperator(), clang::FunctionDecl::isOverloadedOperator(), isStdBasicOstream(), isStdFunctionCall(), and isStdSmartPtr().
|
static |
Definition at line 115 of file SmartPtrModeling.cpp.
References hasStdClassWithName(), and STD_PTR_NAMES.
Referenced by isStdOstreamOperatorCall(), isStdSmartPtr(), clang::ento::smartptr::isStdSmartPtr(), and clang::ento::smartptr::isStdSmartPtrCall().
Definition at line 119 of file SmartPtrModeling.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::Expr::getType(), and isStdSmartPtr().
|
static |
Definition at line 160 of file SmartPtrModeling.cpp.
|
static |
Definition at line 172 of file SmartPtrModeling.cpp.
References State.
|
constexpr |
Definition at line 242 of file SmartPtrModeling.cpp.
Referenced by isStdBasicOstream().
|
constexpr |
Definition at line 112 of file SmartPtrModeling.cpp.
Referenced by isStdSmartPtr().