clang-tools
8.0.0
|
Typedefs | |
typedef std::vector< clang::tooling::TranslationUnitReplacements > | TUReplacements |
Collection of TranslationUnitReplacements. More... | |
typedef std::vector< std::string > | TUReplacementFiles |
Collection of TranslationUnitReplacement files. More... | |
typedef std::vector< clang::tooling::TranslationUnitDiagnostics > | TUDiagnostics |
Collection of TranslationUniDiagnostics. More... | |
typedef llvm::DenseMap< const clang::FileEntry *, std::vector< tooling::AtomicChange > > | FileToChangesMap |
Map mapping file name to a set of AtomicChange targeting that file. More... | |
Functions | |
std::error_code | collectReplacementsFromDirectory (const llvm::StringRef Directory, TUReplacements &TUs, TUReplacementFiles &TUFiles, clang::DiagnosticsEngine &Diagnostics) |
Recursively descends through a directory structure rooted at Directory and attempts to deserialize *.yaml files as TranslationUnitReplacements. More... | |
std::error_code | collectReplacementsFromDirectory (const llvm::StringRef Directory, TUDiagnostics &TUs, TUReplacementFiles &TUFiles, clang::DiagnosticsEngine &Diagnostics) |
bool | mergeAndDeduplicate (const TUReplacements &TUs, const TUDiagnostics &TUDs, FileToChangesMap &FileChanges, clang::SourceManager &SM) |
Deduplicate, check for conflicts, and extract all Replacements stored in TUs . More... | |
llvm::Expected< std::string > | applyChanges (StringRef File, const std::vector< tooling::AtomicChange > &Changes, const tooling::ApplyChangesSpec &Spec, DiagnosticsEngine &Diagnostics) |
Apply AtomicChange on File and rewrite it. More... | |
bool | deleteReplacementFiles (const TUReplacementFiles &Files, clang::DiagnosticsEngine &Diagnostics) |
Delete the replacement files. More... | |
static llvm::DenseMap< const FileEntry *, std::vector< tooling::Replacement > > | groupReplacements (const TUReplacements &TUs, const TUDiagnostics &TUDs, const clang::SourceManager &SM) |
Extract replacements from collected TranslationUnitReplacements and TranslationUnitDiagnostics and group them per file. More... | |
typedef llvm::DenseMap<const clang::FileEntry *, std::vector<tooling::AtomicChange> > clang::replace::FileToChangesMap |
Map mapping file name to a set of AtomicChange targeting that file.
Definition at line 47 of file ApplyReplacements.h.
typedef std::vector<clang::tooling::TranslationUnitDiagnostics> clang::replace::TUDiagnostics |
Collection of TranslationUniDiagnostics.
Definition at line 42 of file ApplyReplacements.h.
typedef std::vector<std::string> clang::replace::TUReplacementFiles |
Collection of TranslationUnitReplacement files.
Definition at line 39 of file ApplyReplacements.h.
typedef std::vector<clang::tooling::TranslationUnitReplacements> clang::replace::TUReplacements |
Collection of TranslationUnitReplacements.
Definition at line 36 of file ApplyReplacements.h.
llvm::Expected< std::string > clang::replace::applyChanges | ( | StringRef | File, |
const std::vector< tooling::AtomicChange > & | Changes, | ||
const tooling::ApplyChangesSpec & | Spec, | ||
DiagnosticsEngine & | Diagnostics | ||
) |
Apply AtomicChange
on File and rewrite it.
[in] | File | Path of the file where to apply AtomicChange. |
[in] | Changes | to apply. |
[in] | Spec | For code cleanup and formatting. |
[in] | Diagnostics | DiagnosticsEngine used for error output. |
Definition at line 229 of file ApplyReplacements.cpp.
std::error_code clang::replace::collectReplacementsFromDirectory | ( | const llvm::StringRef | Directory, |
TUReplacements & | TUs, | ||
TUReplacementFiles & | TUFiles, | ||
clang::DiagnosticsEngine & | Diagnostics | ||
) |
Recursively descends through a directory structure rooted at Directory
and attempts to deserialize *.yaml files as TranslationUnitReplacements.
All docs that successfully deserialize are added to TUs
.
Directories starting with '.' are ignored during traversal.
[in] | Directory | Directory to begin search for serialized TranslationUnitReplacements. |
[out] | TUs | Collection of all found and deserialized TranslationUnitReplacements or TranslationUnitDiagnostics. |
[out] | TUFiles | Collection of all TranslationUnitReplacement files found in Directory . |
[in] | Diagnostics | DiagnosticsEngine used for error output. |
Definition at line 39 of file ApplyReplacements.cpp.
std::error_code clang::replace::collectReplacementsFromDirectory | ( | const llvm::StringRef | Directory, |
TUDiagnostics & | TUs, | ||
TUReplacementFiles & | TUFiles, | ||
clang::DiagnosticsEngine & | Diagnostics | ||
) |
Definition at line 83 of file ApplyReplacements.cpp.
bool clang::replace::deleteReplacementFiles | ( | const TUReplacementFiles & | Files, |
clang::DiagnosticsEngine & | Diagnostics | ||
) |
Delete the replacement files.
[in] | Files | Replacement files to delete. |
[in] | Diagnostics | DiagnosticsEngine used for error output. |
Definition at line 243 of file ApplyReplacements.cpp.
|
static |
Extract replacements from collected TranslationUnitReplacements and TranslationUnitDiagnostics and group them per file.
Identical replacements from diagnostics are deduplicated.
[in] | TUs | Collection of all found and deserialized TranslationUnitReplacements. |
[in] | TUDs | Collection of all found and deserialized TranslationUnitDiagnostics. |
[in] | SM | Used to deduplicate paths. |
Definition at line 140 of file ApplyReplacements.cpp.
bool clang::replace::mergeAndDeduplicate | ( | const TUReplacements & | TUs, |
const TUDiagnostics & | TUDs, | ||
FileToChangesMap & | FileChanges, | ||
clang::SourceManager & | SM | ||
) |
Deduplicate, check for conflicts, and extract all Replacements stored in TUs
.
Conflicting replacements are skipped.
[in] | TUs | Collection of TranslationUnitReplacements or TranslationUnitDiagnostics to merge, deduplicate, and test for conflicts. |
[out] | FileChanges | Container grouping all changes by the file they target. Only non conflicting replacements are kept into FileChanges. |
[in] | SM | SourceManager required for conflict reporting. |
Definition at line 187 of file ApplyReplacements.cpp.