//===--- TransAPIUses.cpp - Transformations to ARC mode -------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // checkAPIUses: // // Emits error/fix with some API uses that are obsolete or not safe in ARC mode: // // - NSInvocation's [get/set]ReturnValue and [get/set]Argument are only safe // with __unsafe_unretained objects. // - Calling -zone gets replaced with 'nil'. // //===----------------------------------------------------------------------===// #include "Transforms.h" #include "Internals.h" #include "clang/AST/ASTContext.h" #include "clang/Sema/SemaDiagnostic.h" usingnamespaceclang; usingnamespacearcmt; usingnamespacetrans; namespace { class APIChecker : public RecursiveASTVisitor<APIChecker> { … }; } // anonymous namespace void trans::checkAPIUses(MigrationPass &pass) { … }