clang 10.0.0git

Macros | Typedefs | Functions
CallEvent.cpp File Reference
`#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"`
`#include "clang/AST/ASTContext.h"`
`#include "clang/AST/Attr.h"`
`#include "clang/AST/Decl.h"`
`#include "clang/AST/DeclBase.h"`
`#include "clang/AST/DeclCXX.h"`
`#include "clang/AST/DeclObjC.h"`
`#include "clang/AST/Expr.h"`
`#include "clang/AST/ExprCXX.h"`
`#include "clang/AST/ExprObjC.h"`
`#include "clang/AST/ParentMap.h"`
`#include "clang/AST/Stmt.h"`
`#include "clang/AST/Type.h"`
`#include "clang/Analysis/AnalysisDeclContext.h"`
`#include "clang/Analysis/CFG.h"`
`#include "clang/Analysis/CFGStmtMap.h"`
`#include "clang/Analysis/PathDiagnostic.h"`
`#include "clang/Analysis/ProgramPoint.h"`
`#include "clang/Basic/IdentifierTable.h"`
`#include "clang/Basic/LLVM.h"`
`#include "clang/Basic/SourceLocation.h"`
`#include "clang/Basic/SourceManager.h"`
`#include "clang/Basic/Specifiers.h"`
`#include "clang/CrossTU/CrossTranslationUnit.h"`
`#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"`
`#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicType.h"`
`#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeInfo.h"`
`#include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h"`
`#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"`
`#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState_Fwd.h"`
`#include "clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h"`
`#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"`
`#include "clang/StaticAnalyzer/Core/PathSensitive/Store.h"`
`#include "llvm/ADT/ArrayRef.h"`
`#include "llvm/ADT/DenseMap.h"`
`#include "llvm/ADT/None.h"`
`#include "llvm/ADT/Optional.h"`
`#include "llvm/ADT/PointerIntPair.h"`
`#include "llvm/ADT/SmallSet.h"`
`#include "llvm/ADT/SmallVector.h"`
`#include "llvm/ADT/StringExtras.h"`
`#include "llvm/ADT/StringRef.h"`
`#include "llvm/Support/Casting.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 <utility>`
Include dependency graph for CallEvent.cpp:

Go to the source code of this file.

## Macros
#define | DEBUG_TYPE "static-analyzer-call-event"

## Typedefs
using | ObjCMessageDataTy = llvm::PointerIntPair< const PseudoObjectExpr *, 2 >

## Functions
static bool | isCallback (QualType T)
static bool | isVoidPointerToNonConst (QualType T)
static bool | isPointerToConst (QualType Ty)
| Returns true if a type is a pointer-to-const or reference-to-const with no further indirection. More...
static void | findPtrToConstParams (llvm::SmallSet< unsigned, 4 > &PreserveArgs, const CallEvent &Call)
static void | addParameterValuesToBindings (const StackFrameContext *CalleeCtx, CallEvent::BindingsTy &Bindings, SValBuilder &SVB, const CallEvent &Call, ArrayRef< ParmVarDecl *> parameters)
static const Expr * | getSyntacticFromForPseudoObjectExpr (const PseudoObjectExpr *POE)
static const ObjCMethodDecl * | findDefiningRedecl (const ObjCMethodDecl *MD)
static bool | isCallToSelfClass (const ObjCMessageExpr *ME)

## Macro Definition Documentation

## ◆ DEBUG_TYPE

#define DEBUG_TYPE "static-analyzer-call-event"

Definition at line 65 of file CallEvent.cpp.

## Typedef Documentation

## ◆ ObjCMessageDataTy

using ObjCMessageDataTy = llvm::PointerIntPair<const PseudoObjectExpr *, 2>

Definition at line 1018 of file CallEvent.cpp.

## Function Documentation

## ◆ addParameterValuesToBindings()

static void addParameterValuesToBindings | ( | const StackFrameContext * | CalleeCtx,
|  | CallEvent::BindingsTy & | Bindings,
|  | SValBuilder & | SVB,
|  | const CallEvent & | Call,
|  | ArrayRef< ParmVarDecl *> | parameters
| ) |  |
| static

Definition at line 505 of file CallEvent.cpp.

References clang::ento::CE_CXXAllocator.

Referenced by clang::ento::AnyFunctionCall::getInitialStackFrameContents(), clang::BlockCall::getInitialStackFrameContents(), and clang::ObjCMethodCall::getInitialStackFrameContents().

## ◆ findDefiningRedecl()

static const ObjCMethodDecl* findDefiningRedecl | ( | const ObjCMethodDecl * | MD | ) |
| static

Definition at line 1158 of file CallEvent.cpp.

References clang::ObjCMethodDecl::hasBody(), and clang::Decl::redecls().

Referenced by clang::ObjCMethodCall::getRuntimeDefinition().

## ◆ findPtrToConstParams()

static void findPtrToConstParams | ( | llvm::SmallSet< unsigned, 4 > & | PreserveArgs,
|  | const CallEvent & | Call
| ) |  |
| static

Definition at line 276 of file CallEvent.cpp.

References isPointerToConst().

Referenced by clang::ento::CallEvent::invalidateRegions().

## ◆ getSyntacticFromForPseudoObjectExpr()

static const Expr* getSyntacticFromForPseudoObjectExpr | ( | const PseudoObjectExpr * | POE | ) |
| static

Definition at line 1027 of file CallEvent.cpp.

References clang::PseudoObjectExpr::getSyntacticForm().

Referenced by clang::ObjCMethodCall::getAccessedProperty().

## ◆ isCallback()

static bool isCallback | ( | QualType | T | ) |
| static

Definition at line 97 of file CallEvent.cpp.

References clang::RecordDecl::fields(), clang::Type::getAsStructureType(), clang::Type::getPointeeType(), clang::Type::isAnyPointerType(), clang::Type::isBlockPointerType(), clang::Type::isFunctionPointerType(), clang::Type::isObjCSelType(), and clang::Type::isReferenceType().

Referenced by clang::ento::CallEvent::hasNonZeroCallbackArg().

## ◆ isCallToSelfClass()

static bool isCallToSelfClass | ( | const ObjCMessageExpr * | ME | ) |
| static

Definition at line 1171 of file CallEvent.cpp.

References clang::ObjCMessageExpr::getInstanceReceiver(), clang::Selector::getNameForSlot(), clang::Selector::getNumArgs(), clang::ObjCMessageExpr::getSelector(), and clang::Expr::IgnoreParenImpCasts().

Referenced by clang::ObjCMethodCall::getRuntimeDefinition().

## ◆ isPointerToConst()

static bool isPointerToConst | ( | QualType | Ty | ) |
| static

Returns true if a type is a pointer-to-const or reference-to-const with no further indirection.

Definition at line 262 of file CallEvent.cpp.

References clang::Type::getPointeeType(), clang::Type::isAnyPointerType(), and clang::QualType::isConstQualified().

Referenced by findPtrToConstParams().

## ◆ isVoidPointerToNonConst()

static bool isVoidPointerToNonConst | ( | QualType | T | ) |
| static

Definition at line 121 of file CallEvent.cpp.

References clang::Type::getAs(), clang::Type::getPointeeType(), clang::QualType::isConstQualified(), and clang::Type::isVoidType().

Referenced by clang::ento::CallEvent::hasVoidPointerToNonConstArg().