clang
3.9.0
|
A tool to run refactorings. More...
#include <Refactoring.h>
Public Member Functions | |
RefactoringTool (const CompilationDatabase &Compilations, ArrayRef< std::string > SourcePaths, std::shared_ptr< PCHContainerOperations > PCHContainerOps=std::make_shared< PCHContainerOperations >()) | |
Replacements & | getReplacements () |
Returns the set of replacements to which replacements should be added during the run of the tool. More... | |
int | runAndSave (FrontendActionFactory *ActionFactory) |
Call run(), apply all generated replacements, and immediately save the results to disk. More... | |
bool | applyAllReplacements (Rewriter &Rewrite) |
Apply all stored replacements to the given Rewriter. More... | |
![]() | |
ClangTool (const CompilationDatabase &Compilations, ArrayRef< std::string > SourcePaths, std::shared_ptr< PCHContainerOperations > PCHContainerOps=std::make_shared< PCHContainerOperations >()) | |
Constructs a clang tool to run over a list of files. More... | |
~ClangTool () | |
void | setDiagnosticConsumer (DiagnosticConsumer *DiagConsumer) |
Set a DiagnosticConsumer to use during parsing. More... | |
void | mapVirtualFile (StringRef FilePath, StringRef Content) |
Map a virtual file to be used while running the tool. More... | |
void | appendArgumentsAdjuster (ArgumentsAdjuster Adjuster) |
Append a command line arguments adjuster to the adjuster chain. More... | |
void | clearArgumentsAdjusters () |
Clear the command line arguments adjuster chain. More... | |
int | run (ToolAction *Action) |
Runs an action over all files specified in the command line. More... | |
int | buildASTs (std::vector< std::unique_ptr< ASTUnit >> &ASTs) |
Create an AST for each file specified in the command line and append them to ASTs. More... | |
FileManager & | getFiles () |
Returns the file manager used in the tool. More... | |
A tool to run refactorings.
This is a refactoring specific version of
Definition at line 37 of file Refactoring.h.
clang::tooling::RefactoringTool::RefactoringTool | ( | const CompilationDatabase & | Compilations, |
ArrayRef< std::string > | SourcePaths, | ||
std::shared_ptr< PCHContainerOperations > | PCHContainerOps = std::make_shared<PCHContainerOperations>() |
||
) |
Definition at line 29 of file Refactoring.cpp.
Apply all stored replacements to the given Rewriter.
Replacement applications happen independently of the success of other applications.
Definition at line 57 of file Refactoring.cpp.
References clang::tooling::applyAllReplacements().
Referenced by runAndSave().
Replacements & clang::tooling::RefactoringTool::getReplacements | ( | ) |
Returns the set of replacements to which replacements should be added during the run of the tool.
Definition at line 34 of file Refactoring.cpp.
int clang::tooling::RefactoringTool::runAndSave | ( | FrontendActionFactory * | ActionFactory | ) |
Call run(), apply all generated replacements, and immediately save the results to disk.
Definition at line 36 of file Refactoring.cpp.
References applyAllReplacements(), clang::tooling::ClangTool::getFiles(), clang::Result, and clang::tooling::ClangTool::run().