#include "clang/Edit/EditedSource.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Edit/Commit.h"
#include "clang/Edit/EditsReceiver.h"
#include "clang/Edit/FileOffset.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include <algorithm>
#include <cassert>
#include <tuple>
#include <utility>
usingnamespaceclang;
usingnamespaceedit;
void EditsReceiver::remove(CharSourceRange range) { … }
void EditedSource::deconstructMacroArgLoc(SourceLocation Loc,
SourceLocation &ExpansionLoc,
MacroArgUse &ArgUse) { … }
void EditedSource::startingCommit() { … }
void EditedSource::finishedCommit() { … }
StringRef EditedSource::copyString(const Twine &twine) { … }
bool EditedSource::canInsertInOffset(SourceLocation OrigLoc, FileOffset Offs) { … }
bool EditedSource::commitInsert(SourceLocation OrigLoc,
FileOffset Offs, StringRef text,
bool beforePreviousInsertions) { … }
bool EditedSource::commitInsertFromRange(SourceLocation OrigLoc,
FileOffset Offs,
FileOffset InsertFromRangeOffs, unsigned Len,
bool beforePreviousInsertions) { … }
void EditedSource::commitRemove(SourceLocation OrigLoc,
FileOffset BeginOffs, unsigned Len) { … }
bool EditedSource::commit(const Commit &commit) { … }
static bool canBeJoined(char left, char right, const LangOptions &LangOpts) { … }
static bool canRemoveWhitespace(char left, char beforeWSpace, char right,
const LangOptions &LangOpts) { … }
static void adjustRemoval(const SourceManager &SM, const LangOptions &LangOpts,
SourceLocation Loc, FileOffset offs,
unsigned &len, StringRef &text) { … }
static void applyRewrite(EditsReceiver &receiver,
StringRef text, FileOffset offs, unsigned len,
const SourceManager &SM, const LangOptions &LangOpts,
bool shouldAdjustRemovals) { … }
void EditedSource::applyRewrites(EditsReceiver &receiver,
bool shouldAdjustRemovals) { … }
void EditedSource::clearRewrites() { … }
StringRef EditedSource::getSourceText(FileOffset BeginOffs, FileOffset EndOffs,
bool &Invalid) { … }
EditedSource::FileEditsTy::iterator
EditedSource::getActionForOffset(FileOffset Offs) { … }