20class GCCollectableCallsChecker :
30 NSMakeCollectableII = &Ids.
get(
"NSMakeCollectable");
31 CFMakeCollectableII = &Ids.
get(
"CFMakeCollectable");
46 if (
DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(CEE)) {
47 if (
FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(DRE->getDecl())) {
48 if (!FD->getDeclContext()->getRedeclContext()->isFileContext())
51 if (FD->getIdentifier() == NSMakeCollectableII) {
54 diag::err_unavailable_message,
55 diag::err_ovl_deleted_call,
56 DRE->getSourceRange());
57 TA.
replace(DRE->getSourceRange(),
"CFBridgingRelease");
59 }
else if (FD->getIdentifier() == CFMakeCollectableII) {
60 TA.
reportError(
"CFMakeCollectable will leak the object that it "
61 "receives in ARC", DRE->getLocation(),
62 DRE->getSourceRange());
Defines the clang::ASTContext interface.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
A reference to a declared variable, function, enum, etc.
This represents one expression.
Expr * IgnoreParenImpCasts() LLVM_READONLY
Skip past any parentheses and implicit casts which might surround this expression until reaching a fi...
Represents a function declaration or definition.
One of these records is kept for each identifier that is lexed.
Implements an efficient mapping from strings to IdentifierInfo nodes.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
A class that does preorder or postorder depth-first traversal on the entire Clang AST and visits each...
bool shouldWalkTypesOfTypeLocs() const
Return whether this visitor should recurse into the types of TypeLocs.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
SourceLocation getBeginLoc() const LLVM_READONLY
MigrationContext & getMigrationContext()
void traverseBody(BodyContext &BodyCtx) override
bool isGCOwnedNonObjC(QualType T)
The JSON file list parser is used to communicate input to InstallAPI.