clang API Documentation

Namespaces | Classes | Typedefs | Functions
clang::arcmt Namespace Reference

Namespaces

namespace  trans

Classes

class  MigrationProcess
class  CheckAction
class  ModifyAction
class  MigrateSourceAction
class  MigrateAction
class  ObjCMigrateAction
 Migrates to modern ObjC syntax. More...
class  FileRemapper
class  CapturedDiagList
class  TransformActions
class  Transaction
class  MigrationPass

Typedefs

typedef void(* TransformFn )(MigrationPass &pass)

Functions

bool checkForManualIssues (CompilerInvocation &CI, const FrontendInputFile &Input, DiagnosticConsumer *DiagClient, bool emitPremigrationARCErrors=false, StringRef plistOut=StringRef())
 Creates an AST with the provided CompilerInvocation but with these changes:
bool applyTransformations (CompilerInvocation &origCI, const FrontendInputFile &Input, DiagnosticConsumer *DiagClient)
 Works similar to checkForManualIssues but instead of checking, it applies automatic modifications to source files to conform to ARC.
bool migrateWithTemporaryFiles (CompilerInvocation &origCI, const FrontendInputFile &Input, DiagnosticConsumer *DiagClient, StringRef outputDir, bool emitPremigrationARCErrors, StringRef plistOut)
 Applies automatic modifications and produces temporary files and metadata into the.
bool getFileRemappings (std::vector< std::pair< std::string, std::string > > &remap, StringRef outputDir, DiagnosticConsumer *DiagClient)
 Get the set of file remappings from the.
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.
std::vector< TransformFngetAllTransformations (LangOptions::GCMode OrigGCMode, bool NoFinalizeRemoval)
void writeARCDiagsToPlist (const std::string &outPath, ArrayRef< StoredDiagnostic > diags, SourceManager &SM, const LangOptions &LangOpts)
static StringRef getARCMTMacroName ()

Typedef Documentation

typedef void(* clang::arcmt::TransformFn)(MigrationPass &pass)

Definition at line 88 of file ARCMT.h.


Function Documentation

bool clang::arcmt::applyTransformations ( CompilerInvocation origCI,
const FrontendInputFile Input,
DiagnosticConsumer DiagClient 
)

Works similar to checkForManualIssues but instead of checking, it applies automatic modifications to source files to conform to ARC.

Returns:
false if no error is produced, true otherwise.

Definition at line 367 of file ARCMT.cpp.

References applyTransforms().

Referenced by clang::arcmt::ModifyAction::BeginInvocation().

bool clang::arcmt::checkForManualIssues ( CompilerInvocation CI,
const FrontendInputFile Input,
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.

Parameters:
emitPremigrationARCErrorsif 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.
plistOutif non-empty, it is the file path to store the plist with the pre-migration ARC diagnostics.
Returns:
false if no error is produced, true otherwise.

Definition at line 223 of file ARCMT.cpp.

References clang::arcmt::CapturedDiagList::begin(), clang::DiagnosticConsumer::BeginSourceFile(), createInvocationForMigration(), emitPremigrationErrors(), clang::arcmt::CapturedDiagList::end(), clang::DiagnosticConsumer::EndSourceFile(), getAllTransformations(), clang::CompilerInvocation::getDiagnosticOpts(), clang::CompilerInvocationBase::getLangOpts(), clang::ASTContext::getLangOpts(), clang::CompilerInvocation::getMigratorOpts(), clang::ASTContext::getSourceManager(), clang::arcmt::CapturedDiagList::hasErrors(), clang::ASTUnit::LoadFromCompilerInvocationAction(), clang::MigratorOptions::NoFinalizeRemoval, clang::MigratorOptions::NoNSAllocReallocError, clang::arcmt::CapturedDiagList::reportDiagnostics(), clang::arcmt::MigrationPass::setNSAllocReallocError(), and writeARCDiagsToPlist().

Referenced by applyTransforms(), and clang::arcmt::CheckAction::BeginInvocation().

std::vector< TransformFn > clang::arcmt::getAllTransformations ( LangOptions::GCMode  OrigGCMode,
bool  NoFinalizeRemoval 
)
static StringRef clang::arcmt::getARCMTMacroName ( ) [inline, static]

Definition at line 162 of file Internals.h.

Referenced by createInvocationForMigration(), and isEmptyARCMTMacroStatement().

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.
Returns:
false if no error is produced, true otherwise.

Definition at line 385 of file ARCMT.cpp.

References clang::arcmt::FileRemapper::applyMappings(), clang::arcmt::FileRemapper::initFromDisk(), and clang::PreprocessorOptions::RemappedFiles.

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.

Returns:
false if no error is produced, true otherwise.

Definition at line 408 of file ARCMT.cpp.

References clang::arcmt::FileRemapper::applyMappings(), clang::arcmt::FileRemapper::initFromFile(), clang::PreprocessorOptions::remapped_file_begin(), and clang::PreprocessorOptions::remapped_file_end().

bool clang::arcmt::migrateWithTemporaryFiles ( CompilerInvocation origCI,
const FrontendInputFile Input,
DiagnosticConsumer DiagClient,
StringRef  outputDir,
bool  emitPremigrationARCErrors,
StringRef  plistOut 
)

Applies automatic modifications and produces temporary files and metadata into the.

  • outputDir path.
Parameters:
emitPremigrationARCErrorsif 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.
plistOutif non-empty, it is the file path to store the plist with the pre-migration ARC diagnostics.
Returns:
false if no error is produced, true otherwise.

Definition at line 374 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 
)