clang-tools 19.0.0git
Functions | Variables
ClangApplyReplacementsMain.cpp File Reference

This file provides the main function for the clang-apply-replacements tool. More...

#include "clang-apply-replacements/Tooling/ApplyReplacements.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/Version.h"
#include "clang/Format/Format.h"
#include "clang/Rewrite/Core/Rewriter.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/Support/CommandLine.h"

Go to the source code of this file.

Functions

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 > IgnoreInsertConflict ("ignore-insert-conflict", cl::desc("Ignore insert conflict and keep running to fix."), 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 (raw_ostream &OS)
 
int main (int argc, char **argv)
 

Variables

const cl::OptionCategory * VisibleCategories []
 

Detailed Description

This file provides the main function for the clang-apply-replacements tool.

Definition in file ClangApplyReplacementsMain.cpp.

Function Documentation

◆ Directory()

static cl::opt< std::string > Directory ( cl::Positional  ,
cl::Required  ,
cl::desc("<Search Root Directory>")   
)
static

◆ DoFormat()

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

Referenced by main().

◆ FormatStyleConfig()

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

Referenced by main().

◆ FormatStyleOpt()

static cl::opt< std::string > FormatStyleOpt ( "style"  ,
cl::desc(format::StyleOptionHelpDescription)  ,
cl::init("LLVM")  ,
cl::cat(FormattingCategory  
)
static

Referenced by main().

◆ FormattingCategory()

static cl::OptionCategory FormattingCategory ( "Formatting Options"  )
static

◆ IgnoreInsertConflict()

static cl::opt< bool > IgnoreInsertConflict ( "ignore-insert-conflict"  ,
cl::desc("Ignore insert conflict and keep running to fix.")  ,
cl::init(false)  ,
cl::cat(ReplacementCategory  
)
static

◆ main()

int main ( int  argc,
char **  argv 
)

◆ printVersion()

static void printVersion ( raw_ostream &  OS)
static

Definition at line 89 of file ClangApplyReplacementsMain.cpp.

References OS.

Referenced by main().

◆ RemoveTUReplacementFiles()

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

Referenced by main().

◆ ReplacementCategory()

static cl::OptionCategory ReplacementCategory ( "Replacement Options"  )
static

Variable Documentation

◆ VisibleCategories

const cl::OptionCategory* VisibleCategories[]
Initial value:
static cl::OptionCategory FormattingCategory("Formatting Options")
static cl::OptionCategory ReplacementCategory("Replacement Options")

Definition at line 36 of file ClangApplyReplacementsMain.cpp.

Referenced by main().