clang 20.0.0git
|
#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/Lex/Lexer.h"
#include "clang/Rewrite/Core/Rewriter.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/RewriteBuffer.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/VirtualFileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <limits>
#include <map>
#include <string>
#include <utility>
#include <vector>
Go to the source code of this file.
Namespaces | |
namespace | clang |
The JSON file list parser is used to communicate input to InstallAPI. | |
namespace | clang::tooling |
Functions | |
bool | clang::tooling::operator< (const Replacement &LHS, const Replacement &RHS) |
Less-than operator between two Replacements. | |
bool | clang::tooling::operator== (const Replacement &LHS, const Replacement &RHS) |
Equal-to operator between two Replacements. | |
static int | getRangeSize (const SourceManager &Sources, const CharSourceRange &Range, const LangOptions &LangOpts) |
static std::string | getReplacementErrString (replacement_error Err) |
static std::vector< Range > | combineAndSortRanges (std::vector< Range > Ranges) |
std::vector< Range > | clang::tooling::calculateRangesAfterReplacements (const Replacements &Replaces, const std::vector< Range > &Ranges) |
Calculates the new ranges after Replaces are applied. | |
bool | clang::tooling::applyAllReplacements (const Replacements &Replaces, Rewriter &Rewrite) |
Apply all replacements in Replaces to the Rewriter Rewrite . | |
llvm::Expected< std::string > | clang::tooling::applyAllReplacements (StringRef Code, const Replacements &Replaces) |
Applies all replacements in Replaces to Code . | |
std::map< std::string, Replacements > | clang::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. | |
Variables | |
static const char *const | InvalidLocation = "" |
Definition at line 485 of file Replacement.cpp.
References clang::tooling::Range::getLength(), clang::tooling::Replacement::getLength(), clang::tooling::Range::getOffset(), clang::tooling::Replacement::getOffset(), and clang::Result.
Referenced by clang::tooling::calculateRangesAfterReplacements(), and clang::tooling::Replacements::getAffectedRanges().
|
static |
Definition at line 135 of file Replacement.cpp.
References clang::SourceManager::getDecomposedLoc(), clang::SourceManager::getSpellingLoc(), and clang::Lexer::MeasureTokenLength().
|
static |
Definition at line 165 of file Replacement.cpp.
References clang::tooling::fail_to_apply, clang::tooling::insert_conflict, clang::tooling::overlap_conflict, and clang::tooling::wrong_file_path.
Referenced by clang::tooling::ReplacementError::message().
|
static |
Definition at line 43 of file Replacement.cpp.
Referenced by clang::tooling::Replacement::isApplicable().