clang 8.0.0

Public Member Functions | Protected Member Functions | List of all members
clang::arcmt::ObjCMigrateAction Class Reference

Migrates to modern ObjC syntax. More...

`#include "clang/ARCMigrate/ARCMTActions.h"`

Inheritance diagram for clang::arcmt::ObjCMigrateAction:
[legend]
Collaboration diagram for clang::arcmt::ObjCMigrateAction:
[legend]

## Public Member Functions
| ObjCMigrateAction (std::unique_ptr< FrontendAction > WrappedAction, StringRef migrateDir, unsigned migrateAction)
Public Member Functions inherited from clang::WrapperFrontendAction
| WrapperFrontendAction (std::unique_ptr< FrontendAction > WrappedAction)
| Construct a WrapperFrontendAction from an existing action, taking ownership of it. More...
bool | usesPreprocessorOnly () const override
| Does this action only use the preprocessor? More...
TranslationUnitKind | getTranslationUnitKind () override
| For AST-based actions, the kind of translation unit we're handling. More...
bool | hasPCHSupport () const override
| Does this action support use with PCH? More...
bool | hasASTFileSupport () const override
| Does this action support use with AST files? More...
bool | hasIRSupport () const override
| Does this action support use with IR files? More...
bool | hasCodeCompletionSupport () const override
| Does this action support use with code completion? More...
Public Member Functions inherited from clang::FrontendAction
| FrontendAction ()
virtual | ~FrontendAction ()
CompilerInstance & | getCompilerInstance () const
void | setCompilerInstance (CompilerInstance *Value)
bool | isCurrentFileAST () const
const FrontendInputFile & | getCurrentInput () const
StringRef | getCurrentFile () const
StringRef | getCurrentFileOrBufferName () const
InputKind | getCurrentFileKind () const
ASTUnit & | getCurrentASTUnit () const
Module * | getCurrentModule () const
std::unique_ptr< ASTUnit > | takeCurrentASTUnit ()
void | setCurrentInput (const FrontendInputFile &CurrentInput, std::unique_ptr< ASTUnit > AST=nullptr)
virtual bool | isModelParsingAction () const
| Is this action invoked on a model file? More...
bool | PrepareToExecute (CompilerInstance &CI)
| Prepare the action to execute on the given compiler instance. More...
bool | BeginSourceFile (CompilerInstance &CI, const FrontendInputFile &Input)
| Prepare the action for processing the input file `Input`. More...
bool | Execute ()
| Set the source manager's main input file, and run the action. More...
void | EndSourceFile ()
| Perform any per-file post processing, deallocate per-file objects, and run statistics and output file cleanup code. More...

## Protected Member Functions
std::unique_ptr< ASTConsumer > | CreateASTConsumer (CompilerInstance &CI, StringRef InFile) override
| Create the AST consumer object for this action, if supported. More...
bool | BeginInvocation (CompilerInstance &CI) override
| Callback before starting processing a single input, giving the opportunity to modify the CompilerInvocation or do some other action before BeginSourceFileAction is called. More...
Protected Member Functions inherited from clang::WrapperFrontendAction
std::unique_ptr< ASTConsumer > | CreateASTConsumer (CompilerInstance &CI, StringRef InFile) override
| Create the AST consumer object for this action, if supported. More...
bool | BeginInvocation (CompilerInstance &CI) override
| Callback before starting processing a single input, giving the opportunity to modify the CompilerInvocation or do some other action before BeginSourceFileAction is called. More...
bool | BeginSourceFileAction (CompilerInstance &CI) override
| Callback at the start of processing a single input. More...
void | ExecuteAction () override
| Callback to run the program action, using the initialized compiler instance. More...
void | EndSourceFileAction () override
| Callback at the end of processing a single input. More...
Protected Member Functions inherited from clang::FrontendAction
virtual bool | PrepareToExecuteAction (CompilerInstance &CI)
| Prepare to execute the action on the given CompilerInstance. More...
virtual bool | shouldEraseOutputFiles ()
| Callback at the end of processing a single input, to determine if the output files should be erased or not. More...

## Detailed Description

Migrates to modern ObjC syntax.

Definition at line 59 of file ARCMTActions.h.

## Constructor & Destructor Documentation

## ◆ ObjCMigrateAction()

ObjCMigrateAction::ObjCMigrateAction | ( | std::unique_ptr< FrontendAction > | WrappedAction,
|  | StringRef | migrateDir,
|  | unsigned | migrateAction
| ) |  |

Definition at line 182 of file ObjCMT.cpp.

## Member Function Documentation

## ◆ BeginInvocation()

bool ObjCMigrateAction::BeginInvocation | ( | CompilerInstance & | CI | ) |
| override protected virtual

Callback before starting processing a single input, giving the opportunity to modify the CompilerInvocation or do some other action before BeginSourceFileAction is called.

Returns
  True on success; on failure BeginSourceFileAction(), ExecuteAction() and EndSourceFileAction() will not be called.

Reimplemented from clang::FrontendAction.

Definition at line 206 of file ObjCMT.cpp.

References clang::ObjCMessageExpr::children(), false, clang::ObjCMethodDecl::findPropertyDecl(), clang::ObjCMessageExpr::getArgs(), clang::SourceRange::getBegin(), clang::Stmt::getBeginLoc(), clang::SourceManager::getCharacterData(), clang::CompilerInstance::getDiagnostics(), clang::SourceRange::getEnd(), clang::Stmt::getEndLoc(), clang::ObjCMessageExpr::getInstanceReceiver(), clang::Preprocessor::getLocForEndOfToken(), clang::SourceLocation::getLocWithOffset(), clang::ObjCMessageExpr::getMethodDecl(), clang::NamedDecl::getName(), clang::ObjCMessageExpr::getNumArgs(), clang::ObjCMessageExpr::getReceiverKind(), clang::ObjCMessageExpr::getSelectorLoc(), clang::Preprocessor::getSourceManager(), clang::Stmt::getSourceRange(), clang::ObjCMessageExpr::getSuperLoc(), clang::Expr::IgnoreImpCasts(), clang::arcmt::FileRemapper::initFromDisk(), clang::edit::Commit::insertBefore(), clang::edit::Commit::insertWrap(), clang::ObjCMessageExpr::Instance, clang::ObjCMessageExpr::isImplicit(), clang::ObjCMethodDecl::isPropertyAccessor(), clang::FrontendOptions::ObjCMT_Literals, clang::FrontendOptions::ObjCMT_PropertyDotSyntax, clang::FrontendOptions::ObjCMT_Subscripting, clang::edit::Commit::replace(), clang::edit::rewriteToObjCLiteralSyntax(), clang::edit::rewriteToObjCSubscriptSyntax(), clang::DiagnosticsEngine::setIgnoreAllWarnings(), subscriptOperatorNeedsParens(), and clang::ObjCMessageExpr::SuperInstance.

## ◆ CreateASTConsumer()

std::unique_ptr< ASTConsumer > ObjCMigrateAction::CreateASTConsumer | ( | CompilerInstance & | CI,
|  | StringRef | InFile
| ) |  |
| override protected virtual

Create the AST consumer object for this action, if supported.

This routine is called as part of BeginSourceFile(), which will fail if the AST consumer cannot be created. This will not be called if the action has indicated that it only uses the preprocessor.

Parameters

  CI | - The current compiler instance, provided as a convenience, see getCompilerInstance().
  InFile | - The current input file, provided as a convenience, see getCurrentFile().

Returns
  The new AST consumer, or null on failure.

Implements clang::FrontendAction.

Definition at line 194 of file ObjCMT.cpp.

References clang::Preprocessor::addPPCallbacks(), clang::WrapperFrontendAction::CreateASTConsumer(), clang::CompilerInstance::getFileManager(), clang::CompilerInstance::getPreprocessor(), and clang::CompilerInstance::getSourceManager().

The documentation for this class was generated from the following files:

- include/clang/ARCMigrate/ARCMTActions.h
- lib/ARCMigrate/ObjCMT.cpp