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; }
40 if (MigrateCtx.isGCOwnedNonObjC(E->
getType())) {
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.
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
const Expr * getCallee() const
One of these records is kept for each identifier that is lexed.
MigrationContext & getMigrationContext()
A class that does preordor 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.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
void traverseBody(BodyContext &BodyCtx) override
detail::InMemoryDirectory::const_iterator E
Expr * IgnoreParenImpCasts() LLVM_READONLY
IgnoreParenImpCasts - Ignore parentheses and implicit casts.
SourceLocation getLocStart() const LLVM_READONLY
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
A reference to a declared variable, function, enum, etc.