clang-tools  3.9.0
Namespaces | Functions
ApplyReplacements.cpp File Reference

This file provides the implementation for deduplicating, detecting conflicts in, and applying collections of Replacements. More...

#include "clang-apply-replacements/Tooling/ApplyReplacements.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Format/Format.h"
#include "clang/Lex/Lexer.h"
#include "clang/Rewrite/Core/Rewriter.h"
#include "clang/Tooling/ReplacementsYaml.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
Include dependency graph for ApplyReplacements.cpp:

Go to the source code of this file.

Namespaces

 clang
 -rename
 
 clang::replace
 

Functions

static void eatDiagnostics (const SMDiagnostic &, void *)
 
std::error_code clang::replace::collectReplacementsFromDirectory (const llvm::StringRef Directory, TUReplacements &TUs, TUReplacementFiles &TURFiles, clang::DiagnosticsEngine &Diagnostics)
 Recursively descends through a directory structure rooted at Directory and attempts to deserialize *.yaml files as TranslationUnitReplacements. More...
 
static void clang::replace::reportConflict (const FileEntry *File, const llvm::ArrayRef< clang::tooling::Replacement > ConflictingReplacements, SourceManager &SM)
 Dumps information for a sequence of conflicting Replacements. More...
 
static bool clang::replace::deduplicateAndDetectConflicts (FileToReplacementsMap &Replacements, SourceManager &SM)
 Deduplicates and tests for conflicts among the replacements for each file in Replacements. More...
 
bool clang::replace::mergeAndDeduplicate (const TUReplacements &TUs, FileToReplacementsMap &GroupedReplacements, clang::SourceManager &SM)
 Deduplicate, check for conflicts, and apply all Replacements stored in TUs. More...
 
bool clang::replace::applyReplacements (const FileToReplacementsMap &GroupedReplacements, clang::Rewriter &Rewrites)
 Apply all replacements in GroupedReplacements. More...
 
RangeVector clang::replace::calculateChangedRanges (const std::vector< clang::tooling::Replacement > &Replacements)
 Given a collection of Replacements for a single file, produces a list of source ranges that enclose those Replacements. More...
 
bool clang::replace::writeFiles (const clang::Rewriter &Rewrites)
 Write the contents of FileContents to disk. More...
 
bool clang::replace::deleteReplacementFiles (const TUReplacementFiles &Files, clang::DiagnosticsEngine &Diagnostics)
 Delete the replacement files. More...
 

Detailed Description

This file provides the implementation for deduplicating, detecting conflicts in, and applying collections of Replacements.

FIXME: Use Diagnostics for output instead of llvm::errs().

Definition in file ApplyReplacements.cpp.

Function Documentation

static void eatDiagnostics ( const SMDiagnostic &  ,
void *   
)
static