9#ifndef LLVM_CLANG_ANALYZER_WEBKIT_ASTUTILS_H
10#define LLVM_CLANG_ANALYZER_WEBKIT_ASTUTILS_H
13#include "llvm/ADT/APInt.h"
14#include "llvm/Support/Casting.h"
56 const clang::Expr *E,
bool StopAtFirstRefCountedObj,
90 using CacheTy = llvm::DenseMap<const FunctionDecl *, bool>;
91 mutable CacheTy Cache{};
98template <
typename T> std::string
safeGetName(
const T *ASTNode) {
99 const auto *
const ND = llvm::dyn_cast_or_null<clang::NamedDecl>(ASTNode);
105 if (!ND->getDeclName().isIdentifier())
108 return ND->getName().str();
bool isACallToEnsureFn(const Expr *E) const
This represents one expression.
Represents an ObjC class declaration.
The base class of the type hierarchy.
The JSON file list parser is used to communicate input to InstallAPI.
bool isExprToGetCheckedPtrCapableMember(const clang::Expr *E)
bool tryToFindPtrOrigin(const Expr *E, bool StopAtFirstRefCountedObj, std::function< bool(const clang::CXXRecordDecl *)> isSafePtr, std::function< bool(const clang::QualType)> isSafePtrType, std::function< bool(const clang::Decl *)> isSafeGlobalDecl, std::function< bool(const clang::Expr *, bool)> callback)
This function de-facto defines a set of transformations that we consider safe (in heuristical sense).
bool isASafeCallArg(const Expr *E)
For E referring to a ref-countable/-counted pointer/reference we return whether it's a safe call argu...
bool isSafePtr(clang::CXXRecordDecl *Decl)
std::string safeGetName(const T *ASTNode)
ObjCInterfaceDecl * getObjCDeclFromObjCPtr(const Type *TypePtr)
bool isNullPtr(const clang::Expr *E)
bool isAllocInit(const Expr *E, const Expr **InnerExpr)
bool isConstOwnerPtrMemberExpr(const clang::Expr *E)
int const char * function