clang API Documentation
Classes | |
class | BodyContext |
class | ObjCImplementationContext |
class | ASTTraverser |
class | MigrationContext |
class | PropertyRewriteTraverser |
class | BlockObjCVariableTraverser |
class | ProtectedScopeTraverser |
class | GCAttrsTraverser |
class | GCCollectableCallsTraverser |
class | BodyTransform |
Typedefs | |
typedef llvm::DenseSet< Expr * > | ExprSet |
Functions | |
void | rewriteAutoreleasePool (MigrationPass &pass) |
void | rewriteUnbridgedCasts (MigrationPass &pass) |
void | makeAssignARCSafe (MigrationPass &pass) |
void | removeRetainReleaseDeallocFinalize (MigrationPass &pass) |
void | removeZeroOutPropsInDeallocFinalize (MigrationPass &pass) |
void | rewriteUnusedInitDelegate (MigrationPass &pass) |
void | checkAPIUses (MigrationPass &pass) |
void | removeEmptyStatementsAndDeallocFinalize (MigrationPass &pass) |
bool | canApplyWeak (ASTContext &Ctx, QualType type, bool AllowOnUnknownClass=false) |
Determine whether we can add weak to the given type. | |
bool | isPlusOneAssign (const BinaryOperator *E) |
bool | isPlusOne (const Expr *E) |
SourceLocation | findLocationAfterSemi (SourceLocation loc, ASTContext &Ctx, bool IsDecl=false) |
'Loc' is the end of a statement range. This returns the location immediately after the semicolon following the statement. If no semicolon is found or the location is inside a macro, the returned source location will be invalid. | |
SourceLocation | findSemiAfterLocation (SourceLocation loc, ASTContext &Ctx, bool IsDecl=false) |
'Loc' is the end of a statement range. This returns the location of the semicolon following the statement. If no semicolon is found or the location is inside a macro, the returned source location will be invalid. | |
bool | hasSideEffects (Expr *E, ASTContext &Ctx) |
bool | isGlobalVar (Expr *E) |
StringRef | getNilString (ASTContext &Ctx) |
Returns "nil" or "0" if 'nil' macro is not actually defined. | |
void | clearRefsIn (Stmt *S, ExprSet &refs) |
template<typename iterator > | |
void | clearRefsIn (iterator begin, iterator end, ExprSet &refs) |
void | collectRefs (ValueDecl *D, Stmt *S, ExprSet &refs) |
void | collectRemovables (Stmt *S, ExprSet &exprs) |
typedef llvm::DenseSet<Expr *> clang::arcmt::trans::ExprSet |
Definition at line 206 of file Transforms.h.
bool clang::arcmt::trans::canApplyWeak | ( | ASTContext & | Ctx, |
QualType | type, | ||
bool | AllowOnUnknownClass = false |
||
) |
Determine whether we can add weak to the given type.
Definition at line 42 of file Transforms.cpp.
References clang::Type::getAs(), clang::ASTContext::getLangOpts(), clang::NamedDecl::getName(), clang::Type::getPointeeType(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ObjCInterfaceDecl::hasDefinition(), clang::ObjCInterfaceDecl::isArcWeakrefUnavailable(), clang::QualType::isNull(), and clang::ast_matchers::type.
Referenced by checkAllAtProps(), checkWeakGCAttrs(), and clang::arcmt::trans::BlockObjCVariableTraverser::traverseBody().
void clang::arcmt::trans::checkAPIUses | ( | MigrationPass & | pass | ) |
Definition at line 106 of file TransAPIUses.cpp.
References clang::arcmt::MigrationPass::Ctx, and clang::ASTContext::getTranslationUnitDecl().
Referenced by independentTransforms().
void clang::arcmt::trans::clearRefsIn | ( | Stmt * | S, |
ExprSet & | refs | ||
) |
Definition at line 309 of file Transforms.cpp.
Referenced by clearRefsIn().
void clang::arcmt::trans::clearRefsIn | ( | iterator | begin, |
iterator | end, | ||
ExprSet & | refs | ||
) |
Definition at line 210 of file Transforms.h.
References clearRefsIn().
void clang::arcmt::trans::collectRefs | ( | ValueDecl * | D, |
Stmt * | S, | ||
ExprSet & | refs | ||
) |
Definition at line 313 of file Transforms.cpp.
void clang::arcmt::trans::collectRemovables | ( | Stmt * | S, |
ExprSet & | exprs | ||
) |
Definition at line 317 of file Transforms.cpp.
SourceLocation clang::arcmt::trans::findLocationAfterSemi | ( | SourceLocation | loc, |
ASTContext & | Ctx, | ||
bool | IsDecl = false |
||
) |
'Loc' is the end of a statement range. This returns the location immediately after the semicolon following the statement. If no semicolon is found or the location is inside a macro, the returned source location will be invalid.
Definition at line 124 of file Transforms.cpp.
References findSemiAfterLocation(), clang::SourceLocation::getLocWithOffset(), and clang::SourceLocation::isInvalid().
Referenced by rewriteToNSEnumDecl().
SourceLocation clang::arcmt::trans::findSemiAfterLocation | ( | SourceLocation | loc, |
ASTContext & | Ctx, | ||
bool | IsDecl = false |
||
) |
'Loc' is the end of a statement range. This returns the location of the semicolon following the statement. If no semicolon is found or the location is inside a macro, the returned source location will be invalid.
Definition at line 136 of file Transforms.cpp.
References clang::SourceManager::getBufferData(), clang::SourceManager::getDecomposedLoc(), clang::ASTContext::getLangOpts(), clang::Lexer::getLocForEndOfToken(), clang::SourceManager::getLocForStartOfFile(), clang::ASTContext::getSourceManager(), clang::Lexer::isAtEndOfMacroExpansion(), clang::SourceLocation::isMacroID(), and SM.
Referenced by findLocationAfterSemi(), isEmptyARCMTMacroStatement(), and rewriteToNSEnumDecl().
StringRef clang::arcmt::trans::getNilString | ( | ASTContext & | Ctx | ) |
Returns "nil" or "0" if 'nil' macro is not actually defined.
Definition at line 215 of file Transforms.cpp.
References clang::IdentifierTable::get(), clang::IdentifierInfo::hasMacroDefinition(), and clang::ASTContext::Idents.
bool clang::arcmt::trans::hasSideEffects | ( | Expr * | E, |
ASTContext & | Ctx | ||
) |
Definition at line 174 of file Transforms.cpp.
References clang::ObjCMessageExpr::getInstanceReceiver(), clang::ObjCMessageExpr::getMethodFamily(), clang::ObjCMessageExpr::getReceiverKind(), clang::Expr::HasSideEffects(), clang::Expr::IgnoreParenCasts(), clang::ObjCMessageExpr::Instance, clang::OMF_autorelease, clang::OMF_dealloc, clang::OMF_release, clang::OMF_retain, and clang::ObjCMessageExpr::SuperInstance.
Definition at line 203 of file Transforms.cpp.
References clang::Expr::IgnoreParenCasts().
bool clang::arcmt::trans::isPlusOne | ( | const Expr * | E | ) |
Definition at line 77 of file Transforms.cpp.
References clang::CK_ARCConsumeObject, clang::CK_BitCast, clang::CastExpr::getCastKind(), clang::CastExpr::getSubExpr(), clang::Expr::IgnoreParenCasts(), clang::ento::cocoa::isRefType(), and clang::OMF_retain.
Referenced by isPlusOneAssign().
bool clang::arcmt::trans::isPlusOneAssign | ( | const BinaryOperator * | E | ) |
Definition at line 70 of file Transforms.cpp.
References clang::BO_Assign, clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getRHS(), and isPlusOne().
void clang::arcmt::trans::makeAssignARCSafe | ( | MigrationPass & | pass | ) |
Definition at line 75 of file TransARCAssign.cpp.
References clang::arcmt::MigrationPass::Ctx, and clang::ASTContext::getTranslationUnitDecl().
Referenced by independentTransforms().
Definition at line 244 of file TransEmptyStatementsAndDealloc.cpp.
References clang::arcmt::MigrationPass::ARCMTMacroLocs, cleanupDeallocOrFinalize(), clang::arcmt::MigrationPass::Ctx, clang::ASTContext::getTranslationUnitDecl(), clang::arcmt::TransformActions::remove(), and clang::arcmt::MigrationPass::TA.
Referenced by clang::arcmt::getAllTransformations().
Definition at line 462 of file TransRetainReleaseDealloc.cpp.
References clang::arcmt::MigrationPass::Ctx, clang::ASTContext::getTranslationUnitDecl(), and clang::RecursiveASTVisitor< BodyTransform< BODY_TRANS > >::TraverseDecl().
Referenced by independentTransforms().
Definition at line 224 of file TransZeroOutPropsInDealloc.cpp.
References clang::arcmt::MigrationPass::Ctx, and clang::ASTContext::getTranslationUnitDecl().
Referenced by independentTransforms().
void clang::arcmt::trans::rewriteAutoreleasePool | ( | MigrationPass & | pass | ) |
Definition at line 432 of file TransAutoreleasePool.cpp.
References clang::arcmt::MigrationPass::Ctx, clang::ASTContext::getTranslationUnitDecl(), and clang::RecursiveASTVisitor< BodyTransform< BODY_TRANS > >::TraverseDecl().
Referenced by independentTransforms().
void clang::arcmt::trans::rewriteUnbridgedCasts | ( | MigrationPass & | pass | ) |
Definition at line 466 of file TransUnbridgedCasts.cpp.
References clang::arcmt::MigrationPass::Ctx, clang::ASTContext::getTranslationUnitDecl(), and clang::RecursiveASTVisitor< BodyTransform< BODY_TRANS > >::TraverseDecl().
Referenced by independentTransforms().
void clang::arcmt::trans::rewriteUnusedInitDelegate | ( | MigrationPass & | pass | ) |
Definition at line 75 of file TransUnusedInitDelegate.cpp.
References clang::arcmt::MigrationPass::Ctx, clang::ASTContext::getTranslationUnitDecl(), and clang::RecursiveASTVisitor< BodyTransform< BODY_TRANS > >::TraverseDecl().
Referenced by independentTransforms().