|
static cl::opt< std::string > | Directory (cl::Positional, cl::Required, cl::desc("<Search Root Directory>")) |
|
static cl::OptionCategory | ReplacementCategory ("Replacement Options") |
|
static cl::OptionCategory | FormattingCategory ("Formatting Options") |
|
static cl::opt< bool > | RemoveTUReplacementFiles ("remove-change-desc-files", cl::desc("Remove the change description files regardless of successful\n""merging/replacing."), cl::init(false), cl::cat(ReplacementCategory)) |
|
static cl::opt< bool > | DoFormat ("format", cl::desc("Enable formatting of code changed by applying replacements.\n""Use -style to choose formatting style.\n"), cl::cat(FormattingCategory)) |
|
static cl::opt< std::string > | FormatStyleConfig ("style-config", cl::desc("Path to a directory containing a .clang-format file\n""describing a formatting style to use for formatting\n""code when -style=file.\n"), cl::init(""), cl::cat(FormattingCategory)) |
|
static cl::opt< std::string > | FormatStyleOpt ("style", cl::desc(format::StyleOptionHelpDescription), cl::init("LLVM"), cl::cat(FormattingCategory)) |
|
static void | printVersion () |
|
static bool | getRewrittenData (const std::vector< tooling::Replacement > &Replacements, Rewriter &Rewrites, std::string &Result) |
| Convenience function to get rewritten content for Filename from Rewrites . More...
|
|
static bool | applyReplacements (const std::vector< tooling::Replacement > &Replacements, std::string &Result, DiagnosticsEngine &Diagnostics) |
| Apply Replacements and return the new file contents. More...
|
|
static bool | applyFormatting (const std::vector< tooling::Replacement > &Replacements, const StringRef FileData, std::string &FormattedFileData, const format::FormatStyle &FormatStyle, DiagnosticsEngine &Diagnostics) |
| Apply code formatting to all places where replacements were made. More...
|
|
int | main (int argc, char **argv) |
|
This file provides the main function for the clang-apply-replacements tool.
Definition in file ClangApplyReplacementsMain.cpp.
static bool getRewrittenData |
( |
const std::vector< tooling::Replacement > & |
Replacements, |
|
|
Rewriter & |
Rewrites, |
|
|
std::string & |
Result |
|
) |
| |
|
static |
Convenience function to get rewritten content for Filename
from Rewrites
.
- Precondition
- Replacements[i].getFilePath() == Replacements[i+1].getFilePath().
- Postcondition
- Replacements.empty() -> Result.empty()
- Parameters
-
[in] | Replacements | Replacements to apply |
[in] | Rewrites | Rewriter to use to apply replacements. |
[out] | Result | Contents of the file after applying replacements if replacements were provided. |
- Returns
- true if all replacements were applied successfully.
- false if at least one replacement failed to apply.
Definition at line 104 of file ClangApplyReplacementsMain.cpp.
References clang::replace::applyAllReplacements(), Files, and SM.
Referenced by applyFormatting(), and applyReplacements().