clang-tools  4.0.0
Classes | Namespaces | Functions
ClangRename.cpp File Reference

This file implements a clang-rename tool that automatically finds and renames symbols in C++ code. More...

#include "../RenamingAction.h"
#include "../USRFindingAction.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TokenKinds.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/ReplacementsYaml.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Support/raw_ostream.h"
#include <cstdlib>
#include <string>
#include <system_error>
Include dependency graph for ClangRename.cpp:

Go to the source code of this file.

Classes

struct  RenameAllInfo
 An oldname -> newname rename. More...
 
struct  llvm::yaml::MappingTraits< RenameAllInfo >
 Specialized MappingTraits to describe how a RenameAllInfo is (de)serialized. More...
 

Namespaces

 llvm
 
 llvm::yaml
 

Functions

static cl::OptionCategory ClangRenameOptions ("clang-rename common options")
 
static cl::list< unsigned > SymbolOffsets ("offset", cl::desc("Locates the symbol by offset as opposed to <line>:<column>."), cl::ZeroOrMore, cl::cat(ClangRenameOptions))
 
static cl::opt< bool > Inplace ("i", cl::desc("Overwrite edited <file>s."), cl::cat(ClangRenameOptions))
 
static cl::list< std::string > QualifiedNames ("qualified-name", cl::desc("The fully qualified name of the symbol."), cl::ZeroOrMore, cl::cat(ClangRenameOptions))
 
static cl::list< std::string > NewNames ("new-name", cl::desc("The new name to change the symbol to."), cl::ZeroOrMore, cl::cat(ClangRenameOptions))
 
static cl::opt< bool > PrintName ("pn", cl::desc("Print the found symbol's name prior to renaming to stderr."), cl::cat(ClangRenameOptions))
 
static cl::opt< bool > PrintLocations ("pl", cl::desc("Print the locations affected by renaming to stderr."), cl::cat(ClangRenameOptions))
 
static cl::opt< std::string > ExportFixes ("export-fixes", cl::desc("YAML file to store suggested fixes in."), cl::value_desc("filename"), cl::cat(ClangRenameOptions))
 
static cl::opt< std::string > Input ("input", cl::desc("YAML file to load oldname-newname pairs from."), cl::Optional, cl::cat(ClangRenameOptions))
 
int main (int argc, const char **argv)
 

Detailed Description

This file implements a clang-rename tool that automatically finds and renames symbols in C++ code.

Definition in file ClangRename.cpp.

Function Documentation

static cl::OptionCategory ClangRenameOptions ( "clang-rename common options"  )
static

Referenced by main().

static cl::opt<std::string> ExportFixes ( "export-fixes"  ,
cl::  desc"YAML file to store suggested fixes in.",
cl::  value_desc"filename",
cl::  catClangRenameOptions 
)
static

Referenced by main().

static cl::opt<bool> Inplace ( "i"  ,
cl::  desc"Overwrite edited <file>s.",
cl::  catClangRenameOptions 
)
static

Referenced by main().

static cl::opt<std::string> Input ( "input"  ,
cl::  desc"YAML file to load oldname-newname pairs from.",
cl::Optional  ,
cl::  catClangRenameOptions 
)
static
int main ( int  argc,
const char **  argv 
)
static cl::list<std::string> NewNames ( "new-name"  ,
cl::  desc"The new name to change the symbol to.",
cl::ZeroOrMore  ,
cl::  catClangRenameOptions 
)
static
static cl::opt<bool> PrintLocations ( "pl"  ,
cl::  desc"Print the locations affected by renaming to stderr.",
cl::  catClangRenameOptions 
)
static
static cl::opt<bool> PrintName ( "pn"  ,
cl::  desc"Print the found symbol's name prior to renaming to stderr.",
cl::  catClangRenameOptions 
)
static

Referenced by main().

static cl::list<std::string> QualifiedNames ( "qualified-name"  ,
cl::  desc"The fully qualified name of the symbol.",
cl::ZeroOrMore  ,
cl::  catClangRenameOptions 
)
static
static cl::list<unsigned> SymbolOffsets ( "offset"  ,
cl::  desc"Locates the symbol by offset as opposed to <line>:<column>.",
cl::ZeroOrMore  ,
cl::  catClangRenameOptions 
)
static