21 #include "llvm/ADT/SmallSet.h"
22 #include "llvm/ADT/StringExtras.h"
23 #include "llvm/Support/raw_ostream.h"
25 using namespace clang;
30 assert(E &&
"Calls without origin expressions do not have results");
68 for (
const auto *
I : RD->
fields()) {
99 I !=
E && Idx < NumOfArgs; ++
I, ++Idx) {
100 if (NumOfArgs <= Idx)
150 I !=
E; ++
I, ++Idx) {
152 PreserveArgs.insert(Idx);
162 if (callee->hasAttr<PureAttr>() || callee->hasAttr<ConstAttr>())
171 llvm::SmallSet<unsigned, 4> PreserveArgs;
178 if (PreserveArgs.count(Idx))
180 ETraits.
setTrait(MR->getBaseRegion(),
184 ValuesToInvalidate.push_back(
getArgSVal(Idx));
190 return Result->invalidateRegions(ValuesToInvalidate,
getOriginExpr(),
193 nullptr,
this, &ETraits);
205 assert(D &&
"Cannot get a program point without a statement or decl");
216 CD.II = &
getState()->getStateManager().getContext().Idents.get(CD.FuncName);
234 return ArgE->getSourceRange();
261 Out <<
"Unknown call (type " <<
getKind() <<
")";
266 return isa<CallExpr>(
S) || isa<ObjCMessageExpr>(S)
267 || isa<CXXConstructExpr>(
S)
268 || isa<CXXNewExpr>(S);
274 return FD->getReturnType();
276 return MD->getReturnType();
277 if (
const BlockDecl *BD = dyn_cast<BlockDecl>(D)) {
289 Ty = FT->getReturnType();
297 llvm_unreachable(
"unknown callable kind");
304 return FD->isVariadic();
306 return MD->isVariadic();
307 if (
const BlockDecl *BD = dyn_cast<BlockDecl>(D))
308 return BD->isVariadic();
310 llvm_unreachable(
"unknown callable kind");
317 ArrayRef<ParmVarDecl*> parameters) {
325 for (; I !=
E && Idx <
NumArgs; ++
I, ++Idx) {
327 assert(ParamDecl &&
"Formal parameter has no decl?");
332 Bindings.push_back(std::make_pair(ParamLoc, ArgVal));
373 if (II->
isStr(
"pthread_setspecific"))
378 if (II->
isStr(
"xpc_connection_set_context"))
382 if (II->
isStr(
"funopen"))
385 StringRef FName = II->
getName();
389 if (FName.endswith(
"NoCopy"))
394 if (FName.startswith(
"NS") && (FName.find(
"Insert") != StringRef::npos))
399 if (FName.startswith(
"CF") || FName.startswith(
"CG")) {
400 return StrInStrNoCase(FName,
"InsertValue") != StringRef::npos ||
401 StrInStrNoCase(FName,
"AddValue") != StringRef::npos ||
402 StrInStrNoCase(FName,
"SetValue") != StringRef::npos ||
403 StrInStrNoCase(FName,
"WithData") != StringRef::npos ||
404 StrInStrNoCase(FName,
"AppendValue") != StringRef::npos ||
405 StrInStrNoCase(FName,
"SetAttribute") != StringRef::npos;
422 const CallExpr *CE = cast_or_null<CallExpr>(getOriginExpr());
430 return getSVal(CE->
getCallee()).getAsFunctionDecl();
435 SVal ThisVal = getCXXThisVal();
436 Values.push_back(ThisVal);
439 if (
const CXXMethodDecl *D = cast_or_null<CXXMethodDecl>(getDecl())) {
460 const Expr *
Base = getCXXThisExpr();
465 SVal ThisVal = getSVal(Base);
473 const Decl *D = getDecl();
483 const MemRegion *R = getCXXThisVal().getAsRegion();
494 assert(!RegionType.
isNull() &&
"DynamicTypeInfo should always be a pointer.");
497 if (!RD || !RD->hasDefinition())
507 assert(!RD->isDerivedFrom(MD->
getParent()) &&
"Couldn't find known method");
521 if (!Result->
hasBody(Definition))
534 BindingsTy &Bindings)
const {
538 SVal ThisVal = getCXXThisVal();
556 assert(!Failed &&
"Calling an incorrectly devirtualized method");
560 Bindings.push_back(std::make_pair(ThisLoc, ThisVal));
567 return getOriginExpr()->getImplicitObjectArgument();
575 if (
const MemberExpr *ME = dyn_cast<MemberExpr>(getOriginExpr()->getCallee()))
576 if (ME->hasQualifier())
584 return getOriginExpr()->getArg(0);
589 const Expr *Callee = getOriginExpr()->getCallee();
590 const MemRegion *DataReg = getSVal(Callee).getAsRegion();
592 return dyn_cast_or_null<BlockDataRegion>(DataReg);
605 if (
const MemRegion *R = getBlockRegion())
610 BindingsTy &Bindings)
const {
613 if (isConversionFromLambda()) {
614 auto *LambdaOperatorDecl = cast<CXXMethodDecl>(CalleeCtx->
getDecl());
615 Params = LambdaOperatorDecl->parameters();
620 const VarRegion *CapturedLambdaRegion = getRegionStoringCapturedLambda();
623 Bindings.push_back(std::make_pair(ThisLoc, ThisVal));
625 Params = cast<BlockDecl>(CalleeCtx->
getDecl())->parameters();
647 BindingsTy &Bindings)
const {
650 SVal ThisVal = getCXXThisVal();
655 Bindings.push_back(std::make_pair(ThisLoc, ThisVal));
668 if (isBaseDestructor())
688 if (
const ObjCIvarDecl *PropIvar = PropDecl->getPropertyIvarDecl()) {
689 SVal IvarLVal = getState()->getLValue(PropIvar, getReceiverSVal());
696 Values.push_back(IvarLVal);
701 Values.push_back(getReceiverSVal());
709 return getState()->getSVal(getState()->getRegion(SelfDecl, LCtx));
714 if (!isInstanceMessage())
717 if (
const Expr *RecE = getOriginExpr()->getInstanceReceiver())
718 return getSVal(RecE);
723 SVal SelfVal = getSelfSVal();
724 assert(SelfVal.
isValid() &&
"Calling super but not in ObjC method");
733 if (!isInstanceMessage())
736 SVal RecVal = getSVal(getOriginExpr()->getInstanceReceiver());
738 return (RecVal == getSelfSVal());
742 switch (getMessageKind()) {
744 return getOriginExpr()->getSourceRange();
747 return getContainingPseudoObjectExpr()->getSourceRange();
749 llvm_unreachable(
"unknown message kind");
754 const PseudoObjectExpr *ObjCMethodCall::getContainingPseudoObjectExpr()
const {
755 assert(Data &&
"Lazy lookup not yet performed.");
756 assert(getMessageKind() !=
OCM_Message &&
"Explicit message send.");
757 return ObjCMessageDataTy::getFromOpaqueValue(Data).getPointer();
766 if (
const BinaryOperator *BO = dyn_cast<BinaryOperator>(Syntactic))
767 Syntactic = BO->getLHS();
776 ParentMap &PM = getLocationContext()->getParentMap();
784 switch (Syntactic->getStmtClass()) {
785 case Stmt::ObjCPropertyRefExprClass:
788 case Stmt::ObjCSubscriptRefExprClass:
800 assert(getMessageKind() == K);
812 if (!Info.getPointer())
821 assert(POE &&
"Property access without PseudoObjectExpr?");
824 auto *RefExpr = cast<ObjCPropertyRefExpr>(Syntactic);
826 if (RefExpr->isExplicitProperty())
827 return RefExpr->getExplicitProperty();
843 getState()->getStateManager().getContext().getSourceManager();
872 if (D->getLocation().isValid() && !SM.
isInMainFile(D->getLocation()))
891 llvm_unreachable(
"The while loop should always terminate.");
903 bool CanBeSubClassed =
false;
907 if (!SupersType.
isNull()) {
910 ReceiverT = cast<ObjCObjectPointerType>(SupersType);
912 Receiver = getReceiverSVal().getAsRegion();
921 if (ReceiverT && CanBeSubClassed)
923 if (!canBeOverridenInSubclass(IDecl, Sel))
924 CanBeSubClassed =
false;
944 typedef std::pair<const ObjCInterfaceDecl*, Selector>
946 typedef llvm::DenseMap<PrivateMethodKey,
950 static PrivateMethodCache PMC;
954 if (!Val.hasValue()) {
955 Val = IDecl->lookupPrivateMethod(Sel);
961 if (CompileTimeMD->isPropertyAccessor()) {
962 if (!CompileTimeMD->getSelfDecl() &&
963 isa<ObjCCategoryDecl>(CompileTimeMD->getDeclContext())) {
974 auto *
ID = CompileTimeMD->getClassInterface();
975 for (
auto *CatDecl :
ID->visible_extensions()) {
976 Val = CatDecl->getMethod(Sel,
977 CompileTimeMD->isInstanceMethod());
983 Val = IDecl->lookupInstanceMethod(Sel);
1008 if (isInSystemHeader() && !isInstanceMessage()) {
1020 BindingsTy &Bindings)
const {
1026 SVal SelfVal = getReceiverSVal();
1027 if (!SelfVal.isUnknown()) {
1031 Bindings.push_back(std::make_pair(SelfLoc, SelfVal));
1039 return create<CXXMemberCall>(MCE,
State, LCtx);
1042 const FunctionDecl *DirectCallee = OpCE->getDirectCallee();
1043 if (
const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(DirectCallee))
1044 if (MD->isInstance())
1045 return create<CXXMemberOperatorCall>(OpCE, State, LCtx);
1048 return create<BlockCall>(CE,
State, LCtx);
1053 return create<SimpleFunctionCall>(CE,
State, LCtx);
1062 assert(CallerCtx &&
"This should not be used for top-level stack frames");
1067 if (
const CallExpr *CE = dyn_cast<CallExpr>(CallSite))
1068 return getSimpleCall(CE, State, CallerCtx);
1070 switch (CallSite->getStmtClass()) {
1071 case Stmt::CXXConstructExprClass:
1072 case Stmt::CXXTemporaryObjectExprClass: {
1073 SValBuilder &SVB = State->getStateManager().getSValBuilder();
1076 SVal ThisVal = State->getSVal(ThisPtr);
1078 return getCXXConstructorCall(cast<CXXConstructExpr>(CallSite),
1081 case Stmt::CXXNewExprClass:
1082 return getCXXAllocatorCall(cast<CXXNewExpr>(CallSite), State, CallerCtx);
1083 case Stmt::ObjCMessageExprClass:
1084 return getObjCMethodCall(cast<ObjCMessageExpr>(CallSite),
1087 llvm_unreachable(
"This is not an inlineable statement.");
1096 "All other CFG elements should have exprs");
1099 SValBuilder &SVB = State->getStateManager().getSValBuilder();
1102 SVal ThisVal = State->getSVal(ThisPtr);
1104 const Stmt *Trigger;
1106 Trigger = AutoDtor->getTriggerStmt();
1108 Trigger = cast<Stmt>(DeleteDtor->getDeleteExpr());
1112 return getCXXDestructorCall(Dtor, Trigger, ThisVal.
getAsRegion(),
Suppress pointer-escaping of a region.
llvm::PointerIntPair< const PseudoObjectExpr *, 2 > ObjCMessageDataTy
bool isObjCSelType() const
virtual SVal getArgSVal(unsigned Index) const
Returns the value of a given argument at the time of the call.
A call to an overloaded operator written using operator syntax.
The receiver is the instance of the superclass object.
void getExtraInvalidatedValues(ValueList &Values, RegionAndSymbolInvalidationTraits *ETraits) const override
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Smart pointer class that efficiently represents Objective-C method names.
SVal evalDynamicCast(SVal Base, QualType DerivedPtrType, bool &Failed)
Evaluates C++ dynamic_cast cast.
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
MemRegion - The root abstract class for all memory regions.
bool canBeASubClass() const
Returns false if the type information is precise (the type T is the only type in the lattice)...
bool argumentsMayEscape() const override
Returns true if any of the arguments are known to escape to long- term storage, even if this method w...
ObjCInterfaceDecl * getClassInterface()
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
bool hasVoidPointerToNonConstArg() const
Returns true if any of the arguments is void*.
static const Expr * getSyntacticFromForPseudoObjectExpr(const PseudoObjectExpr *POE)
Information about invalidation for a particular region/symbol.
FunctionType - C99 6.7.5.3 - Function Declarators.
QualType getRValueReferenceType(QualType T) const
Return the uniqued reference to the type for an rvalue reference to the specified type...
virtual bool argumentsMayEscape() const
Returns true if any of the arguments are known to escape to long- term storage, even if this method w...
const ProgramStateRef & getState() const
The state in which the call is being evaluated.
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type...
CFGDeleteDtor - Represents C++ object destructor generated from a call to delete. ...
QualType getRecordType(const RecordDecl *Decl) const
SourceRange getSourceRange() const override
Represents a program point just before an implicit call event.
A container of type source information.
bool isBlockPointerType() const
CallEventRef getSimpleCall(const CallExpr *E, ProgramStateRef State, const LocationContext *LCtx)
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx, BindingsTy &Bindings) const override
Expr * ignoreParenBaseCasts() LLVM_READONLY
Ignore parentheses and derived-to-base casts.
const ObjCPropertyDecl * findPropertyDecl(bool CheckOverrides=true) const
Returns the property associated with this method's selector.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
const Expr * getCallee() const
bool isCalled(const CallDescription &CD) const
Returns true if the CallEvent is a call to a function that matches the CallDescription.
loc::MemRegionVal getCXXThis(const CXXMethodDecl *D, const StackFrameContext *SFC)
Return a memory region for the 'this' object reference.
void setTrait(SymbolRef Sym, InvalidationKinds IK)
bool isReceiverSelfOrSuper() const
Checks if the receiver refers to 'self' or 'super'.
ObjCMethodDecl - Represents an instance or class method declaration.
SVal getSelfSVal() const
Return the value of 'self' if available.
static bool isVoidPointerToNonConst(QualType T)
const Expr * getCXXThisExpr() const override
Returns the expression representing the implicit 'this' object.
ArrayRef< ParmVarDecl * > parameters() const override
Return call's formal parameters.
const MemRegion * getBaseRegion() const
param_type_iterator param_type_end() const
ParmVarDecl - Represents a parameter to a function.
bool hasMutableFields() const
Determine whether this class, or any of its class subobjects, contains a mutable field.
const ImplicitParamDecl * getSelfDecl() const
Return the ImplicitParamDecl* associated with 'self' if this AnalysisDeclContext wraps an ObjCMethodD...
void getExtraInvalidatedValues(ValueList &Values, RegionAndSymbolInvalidationTraits *ETraits) const override
RecordDecl - Represents a struct/union/class.
bool hasBody(const FunctionDecl *&Definition) const
Returns true if the function has a body (definition).
One of these records is kept for each identifier that is lexed.
RuntimeDefinition getRuntimeDefinition() const override
MemRegionManager & getRegionManager()
IdentifierInfo * getIdentifierInfoForSlot(unsigned argIndex) const
Retrieve the identifier at a given position in the selector.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
bool isReferenceType() const
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
bool isAnyPointerType() const
CFGAutomaticObjDtor - Represents C++ object destructor implicitly generated for automatic object or t...
virtual void getExtraInvalidatedValues(ValueList &Values, RegionAndSymbolInvalidationTraits *ETraits) const
Used to specify non-argument regions that will be invalidated as a result of this call...
AnalysisDeclContext * getAnalysisDeclContext() const
const Expr * getOriginExpr() const
Returns the expression whose value will be the result of this call.
CXXMethodDecl * getCanonicalDecl() override
SValBuilder & getSValBuilder()
const FunctionDecl * getAsFunctionDecl() const
getAsFunctionDecl - If this SVal is a MemRegionVal and wraps a CodeTextRegion wrapping a FunctionDecl...
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
BlockDataRegion - A region that represents a block instance.
Represents any expression that calls an Objective-C method.
virtual Kind getKind() const =0
Returns the kind of call this is.
SVal getReceiverSVal() const
Returns the value of the receiver at the time of this call.
SVal getSVal(const Stmt *S) const
Get the value of arbitrary expressions at this point in the path.
unsigned getIndex() const
QualType getSuperType() const
Retrieve the type referred to by 'super'.
const CXXRecordDecl * getParent() const
Returns the parent of this method declaration, which is the class in which this method is defined...
An x-value expression is a reference to an object with independent storage but which can be "moved"...
const CFGBlock * getCallSiteBlock() const
field_range fields() const
static void findPtrToConstParams(llvm::SmallSet< unsigned, 4 > &PreserveArgs, const CallEvent &Call)
bool isUnknownOrUndef() const
A builtin binary operation expression such as "x + y" or "x <= y".
Selector getSelector() const
const Stmt * getCallSite() const
static bool isPointerToConst(QualType Ty)
Returns true if a type is a pointer-to-const or reference-to-const with no further indirection...
const FunctionDecl * getDecl() const override
Returns the declaration of the function or method that will be called.
ProgramPoint getProgramPoint(bool IsPreVisit=false, const ProgramPointTag *Tag=nullptr) const
Returns an appropriate ProgramPoint for this call.
Represents an ObjC class declaration.
static bool isVariadic(const Decl *D)
Returns true if the given decl is known to be variadic.
detail::InMemoryDirectory::const_iterator I
CXXMethodDecl * getCorrespondingMethodInClass(const CXXRecordDecl *RD, bool MayBeBase=false)
Find the method in RD that corresponds to this one.
virtual bool canBeOverridenInSubclass(ObjCInterfaceDecl *IDecl, Selector Sel) const
Check if the selector may have multiple definitions (may have overrides).
virtual SourceRange getArgSourceRange(unsigned Index) const
Returns the source range for errors associated with this argument.
const Expr * getCXXThisExpr() const override
Returns the expression representing the implicit 'this' object.
ObjCMessageKind
Represents the ways an Objective-C message send can occur.
bool isGlobalCFunction(StringRef SpecificName=StringRef()) const
Returns true if the callee is an externally-visible function in the top-level namespace, such as malloc.
bool isInstanceMessage() const
Determine whether this is an instance message to either a computed object or to super.
ArrayRef< ParmVarDecl * > parameters() const override
CFGBlock - Represents a single basic block in a source-level CFG.
bool argumentsMayEscape() const override
const MemRegion * StripCasts(bool StripBaseCasts=true) const
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
Loc makeLoc(SymbolRef sym)
ArrayRef< ParmVarDecl * > parameters() const override
bool isFunctionPointerType() const
const ObjCMethodDecl * getMethodDecl() const
static bool isCallback(QualType T)
virtual const Expr * getArgExpr(unsigned Index) const
Returns the expression associated with a given argument.
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
Expr - This represents one expression.
StringRef getName() const
Return the actual identifier string.
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx, BindingsTy &Bindings) const override
Stores the currently inferred strictest bound on the runtime type of a region in a given state along ...
const FunctionDecl * getDecl() const override
Returns the declaration of the function or method that will be called.
unsigned getNumArgs() const
CallEventRef getCaller(const StackFrameContext *CalleeCtx, ProgramStateRef State)
static bool isCLibraryFunction(const FunctionDecl *FD, StringRef Name=StringRef())
Returns true if the callee is an externally-visible function in the top-level namespace, such as malloc.
Represents a C++ destructor within a class.
Optional< T > getAs() const
Convert to the specified SVal type, returning None if this SVal is not of the desired type...
ObjCInterfaceDecl * getReceiverInterface() const
Retrieve the Objective-C interface to which this message is being directed, if known.
bool hasNonNullArgumentsWithType(bool(*Condition)(QualType)) const
Returns true if the type of any of the non-null arguments satisfies the condition.
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx, BindingsTy &Bindings) const override
param_type_iterator param_type_begin() const
Returns an iterator over the types of the call's formal parameters.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
RuntimeDefinition getRuntimeDefinition() const override
Returns the definition of the function or method that will be called.
QualType getType() const
Returns the currently inferred upper bound on the runtime type.
An expression that sends a message to the given Objective-C object or class.
StoreManager & getStoreManager()
ArrayRef< ParmVarDecl * > parameters() const
class LLVM_ALIGNAS(8) TemplateSpecializationType unsigned NumArgs
Represents a type template specialization; the template must be a class template, a type alias templa...
void getExtraInvalidatedValues(ValueList &Values, RegionAndSymbolInvalidationTraits *ETraits) const override
CFGBaseDtor - Represents C++ object destructor implicitly generated for base object in destructor...
The result type of a method or function.
const clang::PrintingPolicy & getPrintingPolicy() const
RuntimeDefinition getRuntimeDefinition() const override
ArrayRef< ParmVarDecl * > parameters() const
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx, BindingsTy &Bindings) const override
Populates the given SmallVector with the bindings in the callee's stack frame at the start of this ca...
Stmt * getBody(const FunctionDecl *&Definition) const
getBody - Retrieve the body (definition) of the function.
bool isInMainFile(SourceLocation Loc) const
Returns whether the PresumedLoc for a given SourceLocation is in the main file.
static void addParameterValuesToBindings(const StackFrameContext *CalleeCtx, CallEvent::BindingsTy &Bindings, SValBuilder &SVB, const CallEvent &Call, ArrayRef< ParmVarDecl * > parameters)
Defines the runtime definition of the called function.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
This class represents a description of a function call using the number of arguments and the name of ...
void getExtraInvalidatedValues(ValueList &Values, RegionAndSymbolInvalidationTraits *ETraits) const override
Encodes a location in the source.
const FunctionDecl * getDecl() const override
const TemplateArgument * iterator
const BlockDataRegion * getBlockRegion() const
Returns the region associated with this instance of the block.
const StackFrameContext * getCurrentStackFrame() const
static bool isCallStmt(const Stmt *S)
Returns true if this is a statement is a function or method call of some kind.
ProgramPoints can be "tagged" as representing points specific to a given analysis entity...
bool isValid() const
Return true if this is a valid SourceLocation object.
Represents a call to a member function that may be written either with member call syntax (e...
Represents a static or instance method of a struct/union/class.
ASTContext & getContext()
ArrayRef< ParmVarDecl * > parameters() const
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
bool isPropertyAccessor() const
Represents one property declaration in an Objective-C interface.
const Decl * getDecl() const
SourceLocation getBegin() const
virtual SourceRange getSourceRange() const
Returns a source range for the entire call, suitable for outputting in diagnostics.
RuntimeDefinition getRuntimeDefinition() const override
Tells that a region's contents is not changed.
const IdentifierInfo * getCalleeIdentifier() const
Returns the name of the callee, if its name is a simple identifier.
virtual const Decl * getDecl() const
Returns the declaration of the function or method that will be called.
static const unsigned NoArgRequirement
bool isStr(const char(&Str)[StrLen]) const
Return true if this is the identifier for the specified string.
ProgramStateRef invalidateRegions(unsigned BlockCount, ProgramStateRef Orig=nullptr) const
Returns a new state with all argument regions invalidated.
const LocationContext * getParent() const
bool isValid() const
Return false if no dynamic type info is available.
Represents a program point just after an implicit call event.
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return 0.
DynamicTypeInfo getDynamicTypeInfo(ProgramStateRef State, const MemRegion *Reg)
Get dynamic type information for a region.
RuntimeDefinition getRuntimeDefinition() const override
const VarRegion * getVarRegion(const VarDecl *D, const LocationContext *LC)
getVarRegion - Retrieve or create the memory region associated with a specified VarDecl and LocationC...
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
ProgramStateManager & getStateManager()
detail::InMemoryDirectory::const_iterator E
const MemRegion * getAsRegion() const
SourceLocation getEndOfDefinitionLoc() const
Represents an abstract call to a function or method along a particular path.
ObjCMessageKind getMessageKind() const
Returns how the message was written in the source (property access, subscript, or explicit message se...
const RecordType * getAsStructureType() const
Represents a pointer to an Objective C object.
QualType getResultType() const
Returns the result type, adjusted for references.
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance, bool shallowCategoryLookup=false, bool followSuper=true, const ObjCCategoryDecl *C=nullptr) const
lookupMethod - This method returns an instance/class method by looking in the class, its categories, and its super classes (using a linear search).
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
const T * getAs() const
Member-template getAs<specific type>'.
ObjCInterfaceDecl * getInterfaceDecl() const
If this pointer points to an Objective @interface type, gets the declaration for that interface...
static QualType getDeclaredResultType(const Decl *D)
Returns the result type of a function or method declaration.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
const ImplicitParamDecl * getSelfDecl() const
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Represents a C++ struct/union/class.
SVal getCXXThisVal() const override
Returns the value of the implicit 'this' object.
CFGImplicitDtor - Represents C++ object destructor implicitly generated by compiler on various occasi...
ObjCIvarDecl - Represents an ObjC instance variable.
Stmt * getParentIgnoreParenCasts(Stmt *) const
virtual unsigned getNumArgs() const =0
Returns the number of arguments (explicit and implicit).
CFGElement - Represents a top-level expression in a basic block.
virtual const CallExpr * getOriginExpr() const
const LocationContext * getLocationContext() const
The context in which the call is being evaluated.
SVal getCXXThisVal() const
Returns the value of the implicit 'this' object.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
ObjCInterfaceDecl * getSuperClass() const
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
virtual SVal getCXXThisVal() const
Returns the value of the implicit 'this' object.
llvm::mapped_iterator< ArrayRef< ParmVarDecl * >::iterator, get_type_fun > param_type_iterator
An l-value expression is a reference to an object with independent storage.
A trivial tuple used to represent a source range.
bool hasNonZeroCallbackArg() const
Returns true if any of the arguments appear to represent callbacks.
bool isConstQualified() const
Determine whether this type is const-qualified.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
The receiver is a superclass.
SVal getReturnValue() const
Returns the return value of the call.
const ObjCPropertyDecl * getAccessedProperty() const
This class handles loading and caching of source files into memory.
CFGTemporaryDtor - Represents C++ object destructor implicitly generated at the end of full expressio...
Optional< T > getAs() const
Convert to the specified CFGElement type, returning None if this CFGElement is not of the desired typ...
void getInitialStackFrameContents(const StackFrameContext *CalleeCtx, BindingsTy &Bindings) const override
ArrayRef< SVal > ValueList