clang 20.0.0git
|
#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/CallDescription.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/ImmutableList.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 <optional>
#include <utility>
Go to the source code of this file.
Classes | |
struct | PrivateMethodKey |
struct | llvm::DenseMapInfo< PrivateMethodKey > |
Namespaces | |
namespace | llvm |
Diagnostic wrappers for TextAPI types for error reporting. | |
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. | |
static void | findPtrToConstParams (llvm::SmallSet< unsigned, 4 > &PreserveArgs, const CallEvent &Call) |
static bool | isTransparentUnion (QualType T) |
static SVal | processArgument (SVal Value, const Expr *ArgumentExpr, const ParmVarDecl *Parameter, SValBuilder &SVB) |
static SVal | castArgToParamTypeIfNeeded (const CallEvent &Call, unsigned ArgIdx, SVal ArgVal, SValBuilder &SVB) |
Cast the argument value to the type of the parameter at the function declaration. | |
static void | addParameterValuesToBindings (const StackFrameContext *CalleeCtx, CallEvent::BindingsTy &Bindings, SValBuilder &SVB, const CallEvent &Call, ArrayRef< ParmVarDecl * > parameters) |
static bool | isWithinStdNamespace (const Decl *D) |
static const Expr * | getSyntacticFromForPseudoObjectExpr (const PseudoObjectExpr *POE) |
static const ObjCMethodDecl * | findDefiningRedecl (const ObjCMethodDecl *MD) |
static const ObjCMethodDecl * | lookupRuntimeDefinition (const ObjCInterfaceDecl *Interface, Selector LookupSelector, bool InstanceMethod) |
#define DEBUG_TYPE "static-analyzer-call-event" |
Definition at line 66 of file CallEvent.cpp.
using ObjCMessageDataTy = llvm::PointerIntPair<const PseudoObjectExpr *, 2> |
Definition at line 1064 of file CallEvent.cpp.
|
static |
Definition at line 461 of file CallEvent.cpp.
References clang::Call, castArgToParamTypeIfNeeded(), clang::ento::CE_CXXAllocator, E, clang::ento::MemRegionManager::getParamVarRegion(), clang::ento::SValBuilder::getRegionManager(), clang::ento::SVal::isUnknown(), clang::ento::SValBuilder::makeLoc(), and processArgument().
Referenced by clang::ento::AnyFunctionCall::getInitialStackFrameContents(), clang::ento::BlockCall::getInitialStackFrameContents(), and clang::ento::ObjCMethodCall::getInitialStackFrameContents().
|
static |
Cast the argument value to the type of the parameter at the function declaration.
Returns the argument value if it didn't need a cast. Or returns the cast argument if it needed a cast. Or returns 'Unknown' if it would need a cast but the callsite and the runtime definition don't match in terms of argument and parameter count.
Definition at line 435 of file CallEvent.cpp.
References clang::Call, clang::ento::SValBuilder::evalCast(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), clang::Expr::getType(), and clang::FunctionDecl::hasPrototype().
Referenced by addParameterValuesToBindings().
|
static |
Definition at line 1204 of file CallEvent.cpp.
References clang::ObjCMethodDecl::hasBody(), and clang::Decl::redecls().
Referenced by clang::ento::ObjCMethodCall::getRuntimeDefinition().
|
static |
Definition at line 222 of file CallEvent.cpp.
References clang::Call, E, and isPointerToConst().
Referenced by clang::ento::CallEvent::invalidateRegions().
|
static |
Definition at line 1073 of file CallEvent.cpp.
References clang::PseudoObjectExpr::getSyntacticForm(), and clang::Expr::IgnoreParens().
Referenced by clang::ento::ObjCMethodCall::getAccessedProperty(), and clang::ento::ObjCMethodCall::getMessageKind().
Definition at line 79 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(), clang::Type::isReferenceType(), and clang::T.
Referenced by clang::ento::CallEvent::hasNonZeroCallbackArg().
Returns true if a type is a pointer-to-const or reference-to-const with no further indirection.
Definition at line 208 of file CallEvent.cpp.
References clang::Type::getPointeeType(), clang::Type::isAnyPointerType(), and clang::QualType::isConstQualified().
Definition at line 393 of file CallEvent.cpp.
References clang::Type::getAsUnionType(), clang::RecordType::getDecl(), clang::Decl::hasAttr(), and clang::T.
Referenced by processArgument().
Definition at line 103 of file CallEvent.cpp.
References clang::Type::getAs(), clang::Type::getPointeeType(), clang::QualType::isConstQualified(), clang::Type::isVoidType(), and clang::T.
Referenced by clang::ento::CallEvent::hasVoidPointerToNonConstArg().
Definition at line 926 of file CallEvent.cpp.
References D, clang::Decl::getDeclContext(), and clang::DeclContext::getParent().
Referenced by clang::ento::AnyCXXConstructorCall::getExtraInvalidatedValues().
|
static |
Definition at line 1254 of file CallEvent.cpp.
References clang::Interface.
Referenced by clang::ento::ObjCMethodCall::getRuntimeDefinition().
|
static |
Definition at line 400 of file CallEvent.cpp.
References clang::ento::SValBuilder::getBasicValueFactory(), clang::ento::BasicValueFactory::getEmptySValList(), clang::Expr::getType(), isTransparentUnion(), clang::ento::SValBuilder::makeCompoundVal(), clang::Parameter, and clang::ento::BasicValueFactory::prependSVal().
Referenced by addParameterValuesToBindings().