clang
9.0.0
|
Namespaces | |
trans | |
Classes | |
class | CapturedDiagList |
class | CheckAction |
class | FileRemapper |
class | MigrateAction |
class | MigrateSourceAction |
class | MigrationPass |
class | MigrationProcess |
class | ModifyAction |
class | ObjCMigrateAction |
Migrates to modern ObjC syntax. More... | |
class | Transaction |
class | TransformActions |
Typedefs | |
typedef void(* | TransformFn) (MigrationPass &pass) |
Functions | |
bool | checkForManualIssues (CompilerInvocation &CI, const FrontendInputFile &Input, std::shared_ptr< PCHContainerOperations > PCHContainerOps, DiagnosticConsumer *DiagClient, bool emitPremigrationARCErrors=false, StringRef plistOut=StringRef()) |
Creates an AST with the provided CompilerInvocation but with these changes: -if a PCH/PTH is set, the original header is used instead -Automatic Reference Counting mode is enabled. More... | |
bool | applyTransformations (CompilerInvocation &origCI, const FrontendInputFile &Input, std::shared_ptr< PCHContainerOperations > PCHContainerOps, DiagnosticConsumer *DiagClient) |
Works similar to checkForManualIssues but instead of checking, it applies automatic modifications to source files to conform to ARC. More... | |
bool | migrateWithTemporaryFiles (CompilerInvocation &origCI, const FrontendInputFile &Input, std::shared_ptr< PCHContainerOperations > PCHContainerOps, DiagnosticConsumer *DiagClient, StringRef outputDir, bool emitPremigrationARCErrors, StringRef plistOut) |
Applies automatic modifications and produces temporary files and metadata into the outputDir path. More... | |
bool | getFileRemappings (std::vector< std::pair< std::string, std::string > > &remap, StringRef outputDir, DiagnosticConsumer *DiagClient) |
Get the set of file remappings from the outputDir path that migrateWithTemporaryFiles produced. More... | |
bool | getFileRemappingsFromFileList (std::vector< std::pair< std::string, std::string > > &remap, ArrayRef< StringRef > remapFiles, DiagnosticConsumer *DiagClient) |
Get the set of file remappings from a list of files with remapping info. More... | |
std::vector< TransformFn > | getAllTransformations (LangOptions::GCMode OrigGCMode, bool NoFinalizeRemoval) |
void | writeARCDiagsToPlist (const std::string &outPath, ArrayRef< StoredDiagnostic > diags, SourceManager &SM, const LangOptions &LangOpts) |
static StringRef | getARCMTMacroName () |
typedef void(* clang::arcmt::TransformFn) (MigrationPass &pass) |
bool clang::arcmt::applyTransformations | ( | CompilerInvocation & | origCI, |
const FrontendInputFile & | Input, | ||
std::shared_ptr< PCHContainerOperations > | PCHContainerOps, | ||
DiagnosticConsumer * | DiagClient | ||
) |
Works similar to checkForManualIssues but instead of checking, it applies automatic modifications to source files to conform to ARC.
Definition at line 383 of file ARCMT.cpp.
References applyTransforms().
Referenced by clang::arcmt::ModifyAction::BeginInvocation().
bool clang::arcmt::checkForManualIssues | ( | CompilerInvocation & | CI, |
const FrontendInputFile & | Input, | ||
std::shared_ptr< PCHContainerOperations > | PCHContainerOps, | ||
DiagnosticConsumer * | DiagClient, | ||
bool | emitPremigrationARCErrors = false , |
||
StringRef | plistOut = StringRef() |
||
) |
Creates an AST with the provided CompilerInvocation but with these changes: -if a PCH/PTH is set, the original header is used instead -Automatic Reference Counting mode is enabled.
It then checks the AST and produces errors/warning for ARC migration issues that the user needs to handle manually.
emitPremigrationARCErrors | if true all ARC errors will get emitted even if the migrator can fix them, but the function will still return false if all ARC errors can be fixed. |
plistOut | if non-empty, it is the file path to store the plist with the pre-migration ARC diagnostics. |
Definition at line 236 of file ARCMT.cpp.
References clang::arcmt::CapturedDiagList::begin(), clang::DiagnosticConsumer::BeginSourceFile(), createInvocationForMigration(), emitPremigrationErrors(), clang::arcmt::CapturedDiagList::end(), clang::DiagnosticConsumer::EndSourceFile(), clang::diag::Error, getAllTransformations(), clang::CompilerInvocationBase::getDiagnosticOpts(), clang::CompilerInvocationBase::getLangOpts(), clang::ASTContext::getLangOpts(), clang::CompilerInvocation::getMigratorOpts(), clang::ASTContext::getSourceManager(), i, clang::ASTUnit::LoadFromCompilerInvocationAction(), clang::MigratorOptions::NoFinalizeRemoval, clang::MigratorOptions::NoNSAllocReallocError, clang::arcmt::CapturedDiagList::reportDiagnostics(), clang::arcmt::MigrationPass::setNoFinalizeRemoval(), and writeARCDiagsToPlist().
Referenced by applyTransforms(), and clang::arcmt::CheckAction::BeginInvocation().
std::vector< TransformFn > clang::arcmt::getAllTransformations | ( | LangOptions::GCMode | OrigGCMode, |
bool | NoFinalizeRemoval | ||
) |
Definition at line 582 of file Transforms.cpp.
References clang::LangOptions::GCOnly, GCRewriteFinalize(), independentTransforms(), and clang::arcmt::trans::removeEmptyStatementsAndDeallocFinalize().
Referenced by applyTransforms(), and checkForManualIssues().
|
inlinestatic |
Definition at line 172 of file Internals.h.
Referenced by createInvocationForMigration(), and getFileRemappings().
bool clang::arcmt::getFileRemappings | ( | std::vector< std::pair< std::string, std::string > > & | remap, |
StringRef | outputDir, | ||
DiagnosticConsumer * | DiagClient | ||
) |
Get the set of file remappings from the outputDir
path that migrateWithTemporaryFiles produced.
Definition at line 401 of file ARCMT.cpp.
References clang::Preprocessor::addPPCallbacks(), clang::arcmt::FileRemapper::applyMappings(), clang::arcmt::MigrationProcess::RewriteListener::finish(), getARCMTMacroName(), clang::Token::getIdentifierInfo(), clang::Token::getLocation(), clang::IdentifierInfo::getName(), clang::CompilerInstance::getPreprocessor(), clang::Rewriter::RewriteOptions::IncludeInsertsAtBeginOfRange, clang::Rewriter::RewriteOptions::IncludeInsertsAtEndOfRange, clang::Rewriter::IncreaseIndentation(), clang::arcmt::FileRemapper::initFromDisk(), clang::arcmt::MigrationProcess::RewriteListener::insert(), clang::Rewriter::InsertText(), clang::tooling::range(), clang::PreprocessorOptions::RemappedFiles, clang::arcmt::MigrationProcess::RewriteListener::remove(), clang::Rewriter::RewriteOptions::RemoveLineIfEmpty, clang::Rewriter::RemoveText(), clang::arcmt::MigrationProcess::RewriteListener::start(), and clang::comments::tok::text.
bool clang::arcmt::getFileRemappingsFromFileList | ( | std::vector< std::pair< std::string, std::string > > & | remap, |
ArrayRef< StringRef > | remapFiles, | ||
DiagnosticConsumer * | DiagClient | ||
) |
Get the set of file remappings from a list of files with remapping info.
Definition at line 2229 of file ObjCMT.cpp.
References applyEditsToTemp(), and clang::diff::Insert.
bool clang::arcmt::migrateWithTemporaryFiles | ( | CompilerInvocation & | origCI, |
const FrontendInputFile & | Input, | ||
std::shared_ptr< PCHContainerOperations > | PCHContainerOps, | ||
DiagnosticConsumer * | DiagClient, | ||
StringRef | outputDir, | ||
bool | emitPremigrationARCErrors, | ||
StringRef | plistOut | ||
) |
Applies automatic modifications and produces temporary files and metadata into the outputDir
path.
emitPremigrationARCErrors | if true all ARC errors will get emitted even if the migrator can fix them, but the function will still return false if all ARC errors can be fixed. |
plistOut | if non-empty, it is the file path to store the plist with the pre-migration ARC diagnostics. |
Definition at line 391 of file ARCMT.cpp.
References applyTransforms().
Referenced by clang::arcmt::MigrateAction::BeginInvocation().
void clang::arcmt::writeARCDiagsToPlist | ( | const std::string & | outPath, |
ArrayRef< StoredDiagnostic > | diags, | ||
SourceManager & | SM, | ||
const LangOptions & | LangOpts | ||
) |
Definition at line 34 of file PlistReporter.cpp.
References clang::markup::AddFID(), clang::markup::EmitLocation(), clang::markup::EmitPlistHeader(), clang::markup::EmitRange(), clang::markup::EmitString(), clang::Lexer::getAsCharRange(), clang::DiagnosticIDs::getCategoryNameFromID(), clang::DiagnosticIDs::getCategoryNumberForDiag(), clang::SourceManager::getExpansionRange(), clang::SourceManager::getFileEntryForID(), clang::StoredDiagnostic::getID(), clang::StoredDiagnostic::getLevel(), getLevelName(), clang::StoredDiagnostic::getLocation(), clang::StoredDiagnostic::getMessage(), clang::FileEntry::getName(), clang::StoredDiagnostic::getRanges(), clang::DiagnosticsEngine::Ignored, clang::StoredDiagnostic::range_begin(), and clang::StoredDiagnostic::range_end().
Referenced by checkForManualIssues(), and clang::arcmt::CapturedDiagList::end().