15 using namespace clang;
16 using namespace arcmt;
17 using namespace trans;
21 class GCCollectableCallsChecker :
31 NSMakeCollectableII = &Ids.
get(
"NSMakeCollectable");
32 CFMakeCollectableII = &Ids.
get(
"CFMakeCollectable");
35 bool shouldWalkTypesOfTypeLocs()
const {
return false; }
47 if (
DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(CEE)) {
48 if (
FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(DRE->getDecl())) {
49 if (!FD->getDeclContext()->getRedeclContext()->isFileContext())
52 if (FD->getIdentifier() == NSMakeCollectableII) {
55 diag::err_unavailable_message,
56 diag::err_ovl_deleted_call,
57 DRE->getSourceRange());
58 TA.
replace(DRE->getSourceRange(),
"CFBridgingRelease");
60 }
else if (FD->getIdentifier() == CFMakeCollectableII) {
61 TA.
reportError(
"CFMakeCollectable will leak the object that it " 62 "receives in ARC", DRE->getLocation(),
63 DRE->getSourceRange());
Defines the clang::ASTContext interface.
Represents a function declaration or definition.
bool isGCOwnedNonObjC(QualType T)
One of these records is kept for each identifier that is lexed.
MigrationContext & getMigrationContext()
A class that does preorder or postorder depth-first traversal on the entire Clang AST and visits each...
Expr - This represents one expression.
Implements an efficient mapping from strings to IdentifierInfo nodes.
const Expr * getCallee() const
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
void traverseBody(BodyContext &BodyCtx) override
Dataflow Directional Tag Classes.
SourceLocation getLocStart() const LLVM_READONLY
Expr * IgnoreParenImpCasts() LLVM_READONLY
IgnoreParenImpCasts - Ignore parentheses and implicit casts.
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]).
A reference to a declared variable, function, enum, etc.