clang-tools 8.0.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/DiagnosticsYaml.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
| ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
| clang::replace

## Functions
static void | eatDiagnostics (const SMDiagnostic &, void *)
std::error_code | clang::replace::collectReplacementsFromDirectory (const llvm::StringRef Directory, TUReplacements &TUs, TUReplacementFiles &TUFiles, clang::DiagnosticsEngine &Diagnostics)
| Recursively descends through a directory structure rooted at `Directory` and attempts to deserialize *.yaml files as TranslationUnitReplacements. More...
std::error_code | clang::replace::collectReplacementsFromDirectory (const llvm::StringRef Directory, TUDiagnostics &TUs, TUReplacementFiles &TUFiles, clang::DiagnosticsEngine &Diagnostics)
static llvm::DenseMap< const FileEntry *, std::vector< tooling::Replacement > > | clang::replace::groupReplacements (const TUReplacements &TUs, const TUDiagnostics &TUDs, const clang::SourceManager &SM)
| Extract replacements from collected TranslationUnitReplacements and TranslationUnitDiagnostics and group them per file. More...
bool | clang::replace::mergeAndDeduplicate (const TUReplacements &TUs, const TUDiagnostics &TUDs, FileToChangesMap &FileChanges, clang::SourceManager &SM)
| Deduplicate, check for conflicts, and extract all Replacements stored in `TUs`. More...
llvm::Expected< std::string > | clang::replace::applyChanges (StringRef File, const std::vector< tooling::AtomicChange > &Changes, const tooling::ApplyChangesSpec &Spec, DiagnosticsEngine &Diagnostics)
| Apply `AtomicChange` on File and rewrite it. 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

## ◆ eatDiagnostics()

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

Definition at line 34 of file ApplyReplacements.cpp.