#include "RetainCountDiagnostics.h"
#include "RetainCountChecker.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include <optional>
Go to the source code of this file.
static bool isNumericLiteralExpression (const Expr *E) static std::string getPrettyTypeName (QualType QT) If type represents a pointer to CXXRecordDecl, and is not a typedef, return the decl name.os
, return whether the note should be generated.
S
corresponding to the symbol Sym
.
Insert a diagnostic piece at function exit if a function parameter is annotated as "os_consumed", but it does not actually consume the reference.
Definition at line 373 of file RetainCountDiagnostics.cpp.
References clang::Call, clang::ento::PathDiagnosticLocation::create(), clang::Decl::getASTContext(), getCalleeNode(), clang::ento::CallEventManager::getCaller(), clang::ento::retaincountchecker::RefVal::getCount(), clang::NamedDecl::getNameForDiagnostic(), clang::ASTContext::getPrintingPolicy(), clang::ento::retaincountchecker::getRefBinding(), clang::ento::ExplodedNode::getStackFrame(), clang::ento::ExplodedNode::getState(), clang::Decl::hasAttr(), and SM.
Referenced by clang::ento::retaincountchecker::RefCountReportVisitor::VisitNode().
◆ annotateStartParameter() ◆ describeRegion() static std::optional< std::string > describeRegion ( const MemRegion * MR ) static ◆ findAllocatedObjectName() static std::string findAllocatedObjectName ( const Stmt * S, QualType QT ) static ◆ findArgIdxOfSymbol() ◆ findMetaClassAlloc() static std::optional< std::string > findMetaClassAlloc ( const Expr * Callee ) static ◆ generateDiagnosticsForCallLike()Definition at line 210 of file RetainCountDiagnostics.cpp.
References clang::Call, clang::ento::CF, findAllocatedObjectName(), findArgIdxOfSymbol(), clang::ento::Generalized, clang::Decl::getASTContext(), clang::ento::CallEventManager::getCall(), clang::NamedDecl::getNameForDiagnostic(), clang::ento::CallEventManager::getObjCMethodCall(), clang::ento::retaincountchecker::RefVal::getObjKind(), clang::ObjCObjectPointerType::getPointeeType(), clang::ASTContext::getPrintingPolicy(), clang::NamedDecl::getQualifiedNameAsString(), clang::ento::SymExpr::getType(), clang::ento::retaincountchecker::RefVal::isNotOwned(), clang::QualType::isNull(), clang::ento::retaincountchecker::RefVal::isOwned(), clang::Type::isVoidType(), clang::ento::ObjC, clang::ento::OCM_Message, clang::ento::OCM_PropertyAccess, clang::ento::OCM_Subscript, clang::ento::OS, clang::T, and X.
Referenced by clang::ento::retaincountchecker::RefCountReportVisitor::VisitNode().
◆ GetAllocationSite()Definition at line 668 of file RetainCountDiagnostics.cpp.
References clang::ProgramPoint::getAs(), clang::ento::SVal::getAsSymbol(), clang::ento::ExplodedNode::getFirstPred(), clang::ento::ExplodedNode::getLocation(), clang::ento::ExplodedNode::getLocationContext(), clang::ento::MemRegion::getMemorySpace(), clang::ento::retaincountchecker::getRefBinding(), clang::ento::StoreManager::FindUniqueBinding::getRegion(), clang::LocationContext::getStackFrame(), clang::ento::ExplodedNode::getState(), clang::LocationContext::isParentOf(), clang::ento::ProgramStateManager::iterBindings(), clang::OMF_alloc, and clang::OMF_init.
◆ getAllVarBindingsForSymbol() ◆ getCalleeNode() ◆ getPrettyTypeName() static std::string getPrettyTypeName ( QualType QT ) static ◆ isNumericLiteralExpression() static bool isNumericLiteralExpression ( const Expr * E ) static ◆ shouldGenerateNote() static bool shouldGenerateNote ( llvm::raw_string_ostream & os, const RefVal * PrevT, const RefVal & CurrV, bool DeallocSent ) staticWrite information about the type state change to os
, return whether the note should be generated.
Definition at line 94 of file RetainCountDiagnostics.cpp.
References clang::ento::retaincountchecker::RefVal::getAutoreleaseCount(), clang::ento::retaincountchecker::RefVal::getCombinedCounts(), clang::ento::retaincountchecker::RefVal::getCount(), clang::ento::retaincountchecker::RefVal::getIvarAccessHistory(), clang::ento::retaincountchecker::RefVal::getKind(), clang::ento::retaincountchecker::RefVal::hasSameState(), clang::ento::retaincountchecker::RefVal::NotOwned, clang::ento::retaincountchecker::RefVal::Owned, clang::ento::retaincountchecker::RefVal::Released, clang::ento::retaincountchecker::RefVal::ReleasedAfterDirectAccess, clang::ento::retaincountchecker::RefVal::ReturnedNotOwned, and clang::ento::retaincountchecker::RefVal::ReturnedOwned.
Referenced by clang::ento::retaincountchecker::RefCountReportVisitor::VisitNode().
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4