clang  7.0.0svn
Namespaces | Functions | Variables
Replacement.cpp File Reference
#include "clang/Tooling/Core/Replacement.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticIDs.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/FileSystemOptions.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/VirtualFileSystem.h"
#include "clang/Lex/Lexer.h"
#include "clang/Rewrite/Core/RewriteBuffer.h"
#include "clang/Rewrite/Core/Rewriter.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <limits>
#include <map>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for Replacement.cpp:

Go to the source code of this file.

Namespaces

 clang
 Dataflow Directional Tag Classes.
 
 clang::tooling
 

Functions

bool clang::tooling::operator< (const Replacement &LHS, const Replacement &RHS)
 Less-than operator between two Replacements. More...
 
bool clang::tooling::operator== (const Replacement &LHS, const Replacement &RHS)
 Equal-to operator between two Replacements. More...
 
static int getRangeSize (const SourceManager &Sources, const CharSourceRange &Range, const LangOptions &LangOpts)
 
static std::string getReplacementErrString (replacement_error Err)
 
static std::vector< RangecombineAndSortRanges (std::vector< Range > Ranges)
 
std::vector< Rangeclang::tooling::calculateRangesAfterReplacements (const Replacements &Replaces, const std::vector< Range > &Ranges)
 Calculates the new ranges after Replaces are applied. More...
 
bool clang::tooling::applyAllReplacements (const Replacements &Replaces, Rewriter &Rewrite)
 Apply all replacements in Replaces to the Rewriter Rewrite. More...
 
llvm::Expected< std::string > clang::tooling::applyAllReplacements (StringRef Code, const Replacements &Replaces)
 Applies all replacements in Replaces to Code. More...
 
std::map< std::string, Replacementsclang::tooling::groupReplacementsByFile (FileManager &FileMgr, const std::map< std::string, Replacements > &FileToReplaces)
 If there are multiple <File, Replacements> pairs with the same file entry, we only keep one pair and discard the rest. More...
 

Variables

static const char *const InvalidLocation = ""
 

Function Documentation

◆ combineAndSortRanges()

static std::vector<Range> combineAndSortRanges ( std::vector< Range Ranges)
static

◆ getRangeSize()

static int getRangeSize ( const SourceManager Sources,
const CharSourceRange Range,
const LangOptions LangOpts 
)
static

◆ getReplacementErrString()

static std::string getReplacementErrString ( replacement_error  Err)
static

Variable Documentation

◆ InvalidLocation

const char* const InvalidLocation = ""
static