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;
175 for (
unsigned Idx = 0, Count =
getNumArgs(); Idx != Count; ++Idx) {
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");
215 if (!CD.IsLookupDone) {
216 CD.IsLookupDone =
true;
217 CD.II = &
getState()->getStateManager().getContext().Idents.get(CD.FuncName);
220 if (!II || II != CD.II)
264 Out <<
"Unknown call (type " <<
getKind() <<
")";
269 return isa<CallExpr>(
S) || isa<ObjCMessageExpr>(S)
270 || isa<CXXConstructExpr>(
S)
271 || isa<CXXNewExpr>(S);
277 return FD->getReturnType();
279 return MD->getReturnType();
280 if (
const BlockDecl *BD = dyn_cast<BlockDecl>(D)) {
292 Ty = FT->getReturnType();
300 llvm_unreachable(
"unknown callable kind");
307 return FD->isVariadic();
309 return MD->isVariadic();
310 if (
const BlockDecl *BD = dyn_cast<BlockDecl>(D))
311 return BD->isVariadic();
313 llvm_unreachable(
"unknown callable kind");
320 ArrayRef<ParmVarDecl*> parameters) {
327 ArrayRef<ParmVarDecl*>::iterator
I = parameters.begin(),
E = parameters.end();
328 for (; I !=
E && Idx < NumArgs; ++
I, ++Idx) {
330 assert(ParamDecl &&
"Formal parameter has no decl?");
335 Bindings.push_back(std::make_pair(ParamLoc, ArgVal));
376 if (II->
isStr(
"pthread_setspecific"))
381 if (II->
isStr(
"xpc_connection_set_context"))
385 if (II->
isStr(
"funopen"))
390 if (II->
isStr(
"__cxa_demangle"))
393 StringRef FName = II->
getName();
397 if (FName.endswith(
"NoCopy"))
402 if (FName.startswith(
"NS") && (FName.find(
"Insert") != StringRef::npos))
407 if (FName.startswith(
"CF") || FName.startswith(
"CG")) {
408 return StrInStrNoCase(FName,
"InsertValue") != StringRef::npos ||
409 StrInStrNoCase(FName,
"AddValue") != StringRef::npos ||
410 StrInStrNoCase(FName,
"SetValue") != StringRef::npos ||
411 StrInStrNoCase(FName,
"WithData") != StringRef::npos ||
412 StrInStrNoCase(FName,
"AppendValue") != StringRef::npos ||
413 StrInStrNoCase(FName,
"SetAttribute") != StringRef::npos;
430 const CallExpr *CE = cast_or_null<CallExpr>(getOriginExpr());
438 return getSVal(CE->
getCallee()).getAsFunctionDecl();
443 SVal ThisVal = getCXXThisVal();
444 Values.push_back(ThisVal);
447 if (
const CXXMethodDecl *D = cast_or_null<CXXMethodDecl>(getDecl())) {
468 const Expr *
Base = getCXXThisExpr();
473 SVal ThisVal = getSVal(Base);
481 const Decl *D = getDecl();
491 const MemRegion *R = getCXXThisVal().getAsRegion();
502 assert(!RegionType.
isNull() &&
"DynamicTypeInfo should always be a pointer.");
505 if (!RD || !RD->hasDefinition())
515 assert(!RD->isDerivedFrom(MD->
getParent()) &&
"Couldn't find known method");
529 if (!Result->
hasBody(Definition))
542 BindingsTy &Bindings)
const {
546 SVal ThisVal = getCXXThisVal();
564 assert(!Failed &&
"Calling an incorrectly devirtualized method");
568 Bindings.push_back(std::make_pair(ThisLoc, ThisVal));
575 return getOriginExpr()->getImplicitObjectArgument();
583 if (
const MemberExpr *ME = dyn_cast<MemberExpr>(getOriginExpr()->getCallee()))
584 if (ME->hasQualifier())
592 return getOriginExpr()->getArg(0);
597 const Expr *Callee = getOriginExpr()->getCallee();
598 const MemRegion *DataReg = getSVal(Callee).getAsRegion();
600 return dyn_cast_or_null<BlockDataRegion>(DataReg);
613 if (
const MemRegion *R = getBlockRegion())
618 BindingsTy &Bindings)
const {
621 if (isConversionFromLambda()) {
622 auto *LambdaOperatorDecl = cast<CXXMethodDecl>(CalleeCtx->
getDecl());
623 Params = LambdaOperatorDecl->parameters();
628 const VarRegion *CapturedLambdaRegion = getRegionStoringCapturedLambda();
631 Bindings.push_back(std::make_pair(ThisLoc, ThisVal));
633 Params = cast<BlockDecl>(CalleeCtx->
getDecl())->parameters();
655 BindingsTy &Bindings)
const {
658 SVal ThisVal = getCXXThisVal();
663 Bindings.push_back(std::make_pair(ThisLoc, ThisVal));
676 if (isBaseDestructor())
696 if (
const ObjCIvarDecl *PropIvar = PropDecl->getPropertyIvarDecl()) {
697 SVal IvarLVal = getState()->getLValue(PropIvar, getReceiverSVal());
705 Values.push_back(IvarLVal);
711 Values.push_back(getReceiverSVal());
719 return getState()->getSVal(getState()->getRegion(SelfDecl, LCtx));
724 if (!isInstanceMessage())
727 if (
const Expr *RecE = getOriginExpr()->getInstanceReceiver())
728 return getSVal(RecE);
733 SVal SelfVal = getSelfSVal();
734 assert(SelfVal.
isValid() &&
"Calling super but not in ObjC method");
743 if (!isInstanceMessage())
746 SVal RecVal = getSVal(getOriginExpr()->getInstanceReceiver());
748 return (RecVal == getSelfSVal());
752 switch (getMessageKind()) {
754 return getOriginExpr()->getSourceRange();
757 return getContainingPseudoObjectExpr()->getSourceRange();
759 llvm_unreachable(
"unknown message kind");
764 const PseudoObjectExpr *ObjCMethodCall::getContainingPseudoObjectExpr()
const {
765 assert(Data &&
"Lazy lookup not yet performed.");
766 assert(getMessageKind() !=
OCM_Message &&
"Explicit message send.");
767 return ObjCMessageDataTy::getFromOpaqueValue(Data).getPointer();
776 if (
const BinaryOperator *BO = dyn_cast<BinaryOperator>(Syntactic))
777 Syntactic = BO->getLHS();
786 ParentMap &PM = getLocationContext()->getParentMap();
795 case Stmt::ObjCPropertyRefExprClass:
798 case Stmt::ObjCSubscriptRefExprClass:
810 assert(getMessageKind() == K);
822 if (!Info.getPointer())
831 assert(POE &&
"Property access without PseudoObjectExpr?");
834 auto *RefExpr = cast<ObjCPropertyRefExpr>(Syntactic);
836 if (RefExpr->isExplicitProperty())
837 return RefExpr->getExplicitProperty();
853 getState()->getStateManager().getContext().getSourceManager();
901 llvm_unreachable(
"The while loop should always terminate.");
912 MD = cast<ObjCMethodDecl>(
I);
924 if (!InstRecIg || !InstRecIg->getFoundDecl() ||
925 !InstRecIg->getFoundDecl()->getName().equals(
"self"))
945 bool CanBeSubClassed =
false;
949 if (!SupersType.
isNull()) {
953 ReceiverT = cast<ObjCObjectPointerType>(SupersType);
955 Receiver = getReceiverSVal().getAsRegion();
961 assert(isa<AllocaRegion>(Receiver) &&
962 "Unhandled untyped region class!");
970 if (ReceiverT && CanBeSubClassed)
972 if (!canBeOverridenInSubclass(IDecl, Sel))
973 CanBeSubClassed =
false;
979 if (
auto *PT = dyn_cast_or_null<ObjCObjectPointerType>(ReceiverT)) {
981 if (PT->getObjectType()->isObjCClass() &&
982 Receiver == getSelfSVal().getAsRegion())
1018 typedef std::pair<const ObjCInterfaceDecl*, Selector>
1020 typedef llvm::DenseMap<PrivateMethodKey,
1024 static PrivateMethodCache PMC;
1028 if (!Val.hasValue()) {
1029 Val = IDecl->lookupPrivateMethod(Sel);
1035 if (CompileTimeMD->isPropertyAccessor()) {
1036 if (!CompileTimeMD->getSelfDecl() &&
1037 isa<ObjCCategoryDecl>(CompileTimeMD->getDeclContext())) {
1048 auto *
ID = CompileTimeMD->getClassInterface();
1049 for (
auto *CatDecl :
ID->visible_extensions()) {
1050 Val = CatDecl->getMethod(Sel,
1051 CompileTimeMD->isInstanceMethod());
1057 Val = IDecl->lookupInstanceMethod(Sel);
1062 if (CanBeSubClassed)
1082 if (isInSystemHeader() && !isInstanceMessage()) {
1094 BindingsTy &Bindings)
const {
1100 SVal SelfVal = getReceiverSVal();
1101 if (!SelfVal.isUnknown()) {
1105 Bindings.push_back(std::make_pair(SelfLoc, SelfVal));
1113 return create<CXXMemberCall>(MCE,
State, LCtx);
1116 const FunctionDecl *DirectCallee = OpCE->getDirectCallee();
1117 if (
const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(DirectCallee))
1118 if (MD->isInstance())
1119 return create<CXXMemberOperatorCall>(OpCE, State, LCtx);
1122 return create<BlockCall>(CE,
State, LCtx);
1127 return create<SimpleFunctionCall>(CE,
State, LCtx);
1136 assert(CallerCtx &&
"This should not be used for top-level stack frames");
1141 if (
const CallExpr *CE = dyn_cast<CallExpr>(CallSite))
1142 return getSimpleCall(CE, State, CallerCtx);
1145 case Stmt::CXXConstructExprClass:
1146 case Stmt::CXXTemporaryObjectExprClass: {
1147 SValBuilder &SVB = State->getStateManager().getSValBuilder();
1150 SVal ThisVal = State->getSVal(ThisPtr);
1152 return getCXXConstructorCall(cast<CXXConstructExpr>(CallSite),
1155 case Stmt::CXXNewExprClass:
1156 return getCXXAllocatorCall(cast<CXXNewExpr>(CallSite), State, CallerCtx);
1157 case Stmt::ObjCMessageExprClass:
1158 return getObjCMethodCall(cast<ObjCMessageExpr>(CallSite),
1161 llvm_unreachable(
"This is not an inlineable statement.");
1170 "All other CFG elements should have exprs");
1173 SValBuilder &SVB = State->getStateManager().getSValBuilder();
1176 SVal ThisVal = State->getSVal(ThisPtr);
1178 const Stmt *Trigger;
1180 Trigger = AutoDtor->getTriggerStmt();
1182 Trigger = cast<Stmt>(DeleteDtor->getDeleteExpr());
1186 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.
SVal attemptDownCast(SVal Base, QualType DerivedPtrType, bool &Failed)
Attempts to do a down cast.
StmtClass getStmtClass() const
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.
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)
Stmt - This represents one statement.
Information about invalidation for a particular region/symbol.
FunctionType - C99 6.7.5.3 - Function Declarators.
static bool isCallToSelfClass(const ObjCMessageExpr *ME)
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.
Decl - This represents one declaration (or definition), e.g.
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.
llvm::mapped_iterator< ArrayRef< ParmVarDecl * >::iterator, GetTypeFn > param_type_iterator
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
Retrieves the "canonical" declaration of the given declaration.
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...
static const ObjCMethodDecl * findDefiningRedecl(const ObjCMethodDecl *MD)
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
void getExtraInvalidatedValues(ValueList &Values, RegionAndSymbolInvalidationTraits *ETraits) const override
CFGBaseDtor - Represents C++ object destructor implicitly generated for base object in destructor...
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 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.
StringRef getNameForSlot(unsigned argIndex) const
Retrieve the name at a given position in the selector.
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.
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
static const unsigned NoArgRequirement
bool isStr(const char(&Str)[StrLen]) const
Return true if this is the identifier for the specified string.
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
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
Expr * IgnoreParenImpCasts() LLVM_READONLY
IgnoreParenImpCasts - Ignore parentheses and implicit casts.
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>'.
QualType getCanonicalType() const
ObjCInterfaceDecl * getInterfaceDecl() const
If this pointer points to an Objective @interface type, gets the declaration for that interface...
bool hasBody() const override
Determine whether this method has a body.
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.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
ObjCInterfaceDecl * getSuperClass() const
A reference to a declared variable, function, enum, etc.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
virtual SVal getCXXThisVal() const
Returns the value of the implicit 'this' object.
An l-value expression is a reference to an object with independent storage.
A trivial tuple used to represent a source range.
SourceLocation getLocation() const
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