clang API Documentation
Common wrapper for a call expression, ObjC message, or C++ constructor, mainly to provide a common interface for their arguments. More...
#include <ObjCMessage.h>
Public Member Functions | |
| CallOrObjCMessage (const CallExpr *callE, ProgramStateRef state, const LocationContext *lctx) | |
| CallOrObjCMessage (const CXXConstructExpr *consE, ProgramStateRef state, const LocationContext *lctx) | |
| CallOrObjCMessage (const ObjCMessage &msg, ProgramStateRef state, const LocationContext *lctx) | |
| QualType | getResultType (ASTContext &ctx) const |
| bool | isFunctionCall () const |
| bool | isCXXConstructExpr () const |
| bool | isObjCMessage () const |
| bool | isCXXCall () const |
| bool | isInSystemHeader () const |
| Check if the callee is declared in the system header. | |
| const Expr * | getOriginExpr () const |
| SVal | getFunctionCallee () const |
| SVal | getCXXCallee () const |
| SVal | getInstanceMessageReceiver (const LocationContext *LC) const |
| const Decl * | getDecl () const |
| Get the declaration of the function or method. | |
| unsigned | getNumArgs () const |
| SVal | getArgSVal (unsigned i) const |
| const Expr * | getArg (unsigned i) const |
| SourceRange | getArgSourceRange (unsigned i) const |
| SourceRange | getReceiverSourceRange () const |
| bool | hasNonZeroCallbackArg () const |
| Check if one of the arguments might be a callback. | |
Static Public Member Functions | |
| static bool | isCFCGAllowingEscape (StringRef FName) |
| Check if the name corresponds to a CoreFoundation or CoreGraphics function that allows objects to escape. | |
Common wrapper for a call expression, ObjC message, or C++ constructor, mainly to provide a common interface for their arguments.
Definition at line 162 of file ObjCMessage.h.
| clang::ento::CallOrObjCMessage::CallOrObjCMessage | ( | const CallExpr * | callE, |
| ProgramStateRef | state, | ||
| const LocationContext * | lctx | ||
| ) | [inline] |
Definition at line 171 of file ObjCMessage.h.
| clang::ento::CallOrObjCMessage::CallOrObjCMessage | ( | const CXXConstructExpr * | consE, |
| ProgramStateRef | state, | ||
| const LocationContext * | lctx | ||
| ) | [inline] |
Definition at line 174 of file ObjCMessage.h.
| clang::ento::CallOrObjCMessage::CallOrObjCMessage | ( | const ObjCMessage & | msg, |
| ProgramStateRef | state, | ||
| const LocationContext * | lctx | ||
| ) | [inline] |
Definition at line 177 of file ObjCMessage.h.
| const Expr* clang::ento::CallOrObjCMessage::getArg | ( | unsigned | i | ) | const [inline] |
Definition at line 242 of file ObjCMessage.h.
References clang::ento::ObjCMessage::getArgExpr(), and getNumArgs().
Referenced by getArgSourceRange(), and getArgSVal().
| SourceRange clang::ento::CallOrObjCMessage::getArgSourceRange | ( | unsigned | i | ) | const [inline] |
Definition at line 252 of file ObjCMessage.h.
References getArg(), clang::ento::ObjCMessage::getArgSourceRange(), getNumArgs(), and clang::Stmt::getSourceRange().
| SVal clang::ento::CallOrObjCMessage::getArgSVal | ( | unsigned | i | ) | const [inline] |
Definition at line 235 of file ObjCMessage.h.
References getArg(), clang::ento::ObjCMessage::getArgSVal(), and getNumArgs().
Referenced by clang::ento::ExprEngine::invalidateArguments().
| SVal CallOrObjCMessage::getCXXCallee | ( | ) | const |
Definition at line 54 of file ObjCMessage.cpp.
References isCXXCall().
Referenced by clang::ento::ExprEngine::invalidateArguments().
| const Decl * CallOrObjCMessage::getDecl | ( | ) | const |
Get the declaration of the function or method.
Definition at line 227 of file MemRegion.cpp.
References clang::ento::DeclRegion::D.
Referenced by isInSystemHeader().
| SVal CallOrObjCMessage::getFunctionCallee | ( | ) | const |
Definition at line 47 of file ObjCMessage.cpp.
References clang::Expr::IgnoreParens(), isCXXCall(), and isFunctionCall().
Referenced by clang::ento::ExprEngine::invalidateArguments().
| SVal CallOrObjCMessage::getInstanceMessageReceiver | ( | const LocationContext * | LC | ) | const |
Definition at line 69 of file ObjCMessage.cpp.
References clang::ento::ObjCMessage::getInstanceReceiverSVal(), and isObjCMessage().
Referenced by clang::ento::ExprEngine::invalidateArguments().
| unsigned clang::ento::CallOrObjCMessage::getNumArgs | ( | ) | const [inline] |
Definition at line 226 of file ObjCMessage.h.
References clang::ento::ObjCMessage::getNumArgs().
Referenced by getArg(), getArgSourceRange(), getArgSVal(), hasNonZeroCallbackArg(), and clang::ento::ExprEngine::invalidateArguments().
| const Expr* clang::ento::CallOrObjCMessage::getOriginExpr | ( | ) | const [inline] |
Definition at line 210 of file ObjCMessage.h.
References clang::ento::ObjCMessage::getMessageExpr().
Referenced by clang::ento::ExprEngine::invalidateArguments().
| SourceRange clang::ento::CallOrObjCMessage::getReceiverSourceRange | ( | ) | const [inline] |
Definition at line 259 of file ObjCMessage.h.
References clang::ento::ObjCMessage::getReceiverSourceRange(), and isObjCMessage().
| QualType CallOrObjCMessage::getResultType | ( | ASTContext & | ctx | ) | const |
Definition at line 21 of file ObjCMessage.cpp.
References clang::CallExpr::getCallee(), clang::ASTContext::getPointerType(), clang::ento::ObjCMessage::getResultType(), clang::Expr::getType(), clang::Expr::isGLValue(), and isObjCMessage().
| bool CallOrObjCMessage::hasNonZeroCallbackArg | ( | ) | const |
Check if one of the arguments might be a callback.
Definition at line 119 of file ObjCMessage.cpp.
References clang::CallExpr::getCalleeDecl(), clang::ento::ObjCMessage::getMethodDecl(), getNumArgs(), clang::ObjCMethodDecl::param_begin(), and clang::ObjCMethodDecl::param_end().
| bool CallOrObjCMessage::isCFCGAllowingEscape | ( | StringRef | FName | ) | [static] |
Check if the name corresponds to a CoreFoundation or CoreGraphics function that allows objects to escape.
Many methods allow a tracked object to escape. For example:
CFMutableDictionaryRef x = CFDictionaryCreateMutable(..., customDeallocator); CFDictionaryAddValue(y, key, x);
We handle this and similar cases with the following heuristic. If the function name contains "InsertValue", "SetValue", "AddValue", "AppendValue", or "SetAttribute", then we assume that arguments may escape.
Definition at line 163 of file ObjCMessage.cpp.
| bool clang::ento::CallOrObjCMessage::isCXXCall | ( | ) | const [inline] |
Definition at line 195 of file ObjCMessage.h.
Referenced by getCXXCallee(), getFunctionCallee(), and clang::ento::ExprEngine::invalidateArguments().
| bool clang::ento::CallOrObjCMessage::isCXXConstructExpr | ( | ) | const [inline] |
Definition at line 187 of file ObjCMessage.h.
| bool clang::ento::CallOrObjCMessage::isFunctionCall | ( | ) | const [inline] |
Definition at line 183 of file ObjCMessage.h.
Referenced by getFunctionCallee(), and clang::ento::ExprEngine::invalidateArguments().
| bool clang::ento::CallOrObjCMessage::isInSystemHeader | ( | ) | const [inline] |
Check if the callee is declared in the system header.
Definition at line 201 of file ObjCMessage.h.
References getDecl(), and clang::SourceManager::isInSystemHeader().
| bool clang::ento::CallOrObjCMessage::isObjCMessage | ( | ) | const [inline] |
Definition at line 191 of file ObjCMessage.h.
Referenced by getInstanceMessageReceiver(), getReceiverSourceRange(), getResultType(), and clang::ento::ExprEngine::invalidateArguments().