#include "TestSupport.h"
#include "clang/Frontend/CommandLineSourceLoc.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "clang/Rewrite/Core/Rewriter.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "clang/Tooling/Refactoring.h"
#include "clang/Tooling/Refactoring/RefactoringAction.h"
#include "clang/Tooling/Refactoring/RefactoringOptions.h"
#include "clang/Tooling/Refactoring/Rename/RenamingAction.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
#include <string>
usingnamespaceclang;
usingnamespacetooling;
usingnamespacerefactor;
cl;
namespace opts {
static cl::OptionCategory CommonRefactorOptions("Refactoring options");
static cl::opt<bool> Verbose("v", cl::desc("Use verbose output"),
cl::cat(cl::getGeneralCategory()),
cl::sub(cl::SubCommand::getAll()));
static cl::opt<bool> Inplace("i", cl::desc("Inplace edit <file>s"),
cl::cat(cl::getGeneralCategory()),
cl::sub(cl::SubCommand::getAll()));
}
namespace {
class SourceSelectionArgument { … };
class TestSourceSelectionArgument final : public SourceSelectionArgument { … };
class SourceRangeSelectionArgument final : public SourceSelectionArgument { … };
std::unique_ptr<SourceSelectionArgument>
SourceSelectionArgument::fromString(StringRef Value) { … }
class RefactoringActionCommandLineOptions { … };
class CommandLineRefactoringOptionVisitor final
: public RefactoringOptionVisitor { … };
class CommandLineRefactoringOptionCreator final
: public RefactoringOptionVisitor { … };
class RefactoringActionSubcommand : public cl::SubCommand { … };
class ClangRefactorConsumer final : public ClangRefactorToolConsumerInterface { … };
class ClangRefactorTool { … };
}
int main(int argc, const char **argv) { … }