clang 20.0.0git
Classes | Typedefs | Functions
clang::arcmt::trans Namespace Reference

Classes

class  ASTTraverser
 
class  BlockObjCVariableTraverser
 
class  BodyContext
 
class  BodyTransform
 
class  GCAttrsTraverser
 
class  GCCollectableCallsTraverser
 
class  MigrationContext
 
class  ObjCImplementationContext
 
class  PropertyRewriteTraverser
 
class  ProtectedScopeTraverser
 

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.
 
SourceLocation findSemiAfterLocation (SourceLocation loc, ASTContext &Ctx, bool IsDecl=false)
 'Loc' is the end of a statement range.
 
bool hasSideEffects (Expr *E, ASTContext &Ctx)
 
bool isGlobalVar (Expr *E)
 
StringRef getNilString (MigrationPass &Pass)
 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 Documentation

◆ ExprSet

typedef llvm::DenseSet<Expr *> clang::arcmt::trans::ExprSet

Definition at line 205 of file Transforms.h.

Function Documentation

◆ canApplyWeak()

bool clang::arcmt::trans::canApplyWeak ( ASTContext Ctx,
QualType  type,
bool  AllowOnUnknownClass = false 
)

◆ checkAPIUses()

void clang::arcmt::trans::checkAPIUses ( MigrationPass pass)

◆ clearRefsIn() [1/2]

template<typename iterator >
void clang::arcmt::trans::clearRefsIn ( iterator  begin,
iterator  end,
ExprSet refs 
)

Definition at line 209 of file Transforms.h.

References clearRefsIn().

◆ clearRefsIn() [2/2]

void clang::arcmt::trans::clearRefsIn ( Stmt S,
ExprSet refs 
)

Definition at line 300 of file Transforms.cpp.

Referenced by clearRefsIn().

◆ collectRefs()

void clang::arcmt::trans::collectRefs ( ValueDecl D,
Stmt S,
ExprSet refs 
)

Definition at line 304 of file Transforms.cpp.

References D.

◆ collectRemovables()

void clang::arcmt::trans::collectRemovables ( Stmt S,
ExprSet exprs 
)

Definition at line 308 of file Transforms.cpp.

◆ findLocationAfterSemi()

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 117 of file Transforms.cpp.

References findSemiAfterLocation(), clang::SourceLocation::getLocWithOffset(), and clang::SourceLocation::isInvalid().

Referenced by rewriteToNSEnumDecl().

◆ findSemiAfterLocation()

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.

  • 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 129 of file Transforms.cpp.

References findSemiAfterLocation(), clang::ASTContext::getLangOpts(), clang::Token::getLocation(), clang::Lexer::getLocForEndOfToken(), clang::ASTContext::getSourceManager(), clang::Lexer::isAtEndOfMacroExpansion(), clang::SourceLocation::isMacroID(), clang::Token::isNot(), clang::Lexer::LexFromRawLexer(), and SM.

Referenced by findLocationAfterSemi(), findSemiAfterLocation(), isEmptyARCMTMacroStatement(), and rewriteToNSEnumDecl().

◆ getNilString()

StringRef clang::arcmt::trans::getNilString ( MigrationPass Pass)

Returns "nil" or "0" if 'nil' macro is not actually defined.

Definition at line 208 of file Transforms.cpp.

References clang::Preprocessor::isMacroDefined(), clang::Sema::PP, and clang::arcmt::MigrationPass::SemaRef.

◆ hasSideEffects()

bool clang::arcmt::trans::hasSideEffects ( Expr E,
ASTContext Ctx 
)

◆ isGlobalVar()

bool clang::arcmt::trans::isGlobalVar ( Expr E)

Definition at line 196 of file Transforms.cpp.

References E, clang::Expr::IgnoreParenCasts(), and isGlobalVar().

Referenced by isGlobalVar().

◆ isPlusOne()

bool clang::arcmt::trans::isPlusOne ( const Expr E)

◆ isPlusOneAssign()

bool clang::arcmt::trans::isPlusOneAssign ( const BinaryOperator E)

Definition at line 68 of file Transforms.cpp.

References E, and isPlusOne().

◆ makeAssignARCSafe()

void clang::arcmt::trans::makeAssignARCSafe ( MigrationPass pass)

◆ removeEmptyStatementsAndDeallocFinalize()

void clang::arcmt::trans::removeEmptyStatementsAndDeallocFinalize ( MigrationPass pass)

◆ removeRetainReleaseDeallocFinalize()

void clang::arcmt::trans::removeRetainReleaseDeallocFinalize ( MigrationPass pass)

◆ removeZeroOutPropsInDeallocFinalize()

void clang::arcmt::trans::removeZeroOutPropsInDeallocFinalize ( MigrationPass pass)

◆ rewriteAutoreleasePool()

void clang::arcmt::trans::rewriteAutoreleasePool ( MigrationPass pass)

◆ rewriteUnbridgedCasts()

void clang::arcmt::trans::rewriteUnbridgedCasts ( MigrationPass pass)

◆ rewriteUnusedInitDelegate()

void clang::arcmt::trans::rewriteUnusedInitDelegate ( MigrationPass pass)