#include #include #include ">

clang: lib/Edit/EditedSource.cpp File Reference (original) (raw)

#include "[clang/Edit/EditedSource.h](EditedSource%5F8h%5Fsource.html)"
#include "[clang/Basic/CharInfo.h](CharInfo%5F8h%5Fsource.html)"
#include "[clang/Basic/LLVM.h](LLVM%5F8h%5Fsource.html)"
#include "[clang/Basic/SourceLocation.h](SourceLocation%5F8h%5Fsource.html)"
#include "[clang/Basic/SourceManager.h](SourceManager%5F8h%5Fsource.html)"
#include "[clang/Edit/Commit.h](Commit%5F8h%5Fsource.html)"
#include "[clang/Edit/EditsReceiver.h](EditsReceiver%5F8h%5Fsource.html)"
#include "[clang/Edit/FileOffset.h](FileOffset%5F8h%5Fsource.html)"
#include "[clang/Lex/Lexer.h](Lexer%5F8h%5Fsource.html)"
#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>

Go to the source code of this file.

Functions
static bool canBeJoined (char left, char right, const LangOptions &LangOpts)
static bool canRemoveWhitespace (char left, char beforeWSpace, char right, const LangOptions &LangOpts)
Returns true if it is ok to eliminate the trailing whitespace between the given characters.
static void adjustRemoval (const SourceManager &SM, const LangOptions &LangOpts, SourceLocation Loc, FileOffset offs, unsigned &len, StringRef &text)
Check the range that we are going to remove and: -Remove any trailing whitespace if possible.
static void applyRewrite (EditsReceiver &receiver, StringRef text, FileOffset offs, unsigned len, const SourceManager &SM, const LangOptions &LangOpts, bool shouldAdjustRemovals)

adjustRemoval()

applyRewrite()

Definition at line 382 of file EditedSource.cpp.

References adjustRemoval(), clang::CharSourceRange::getCharRange(), clang::edit::FileOffset::getFID(), clang::SourceLocation::getLocWithOffset(), clang::edit::FileOffset::getOffset(), clang::edit::EditsReceiver::insert(), clang::SourceLocation::isFileID(), clang::FileID::isValid(), Loc, clang::edit::EditsReceiver::remove(), clang::edit::EditsReceiver::replace(), and SM.

Referenced by clang::edit::EditedSource::applyRewrites().

canBeJoined()

static bool canBeJoined ( char left, char right, const LangOptions & LangOpts ) static

canRemoveWhitespace()

static bool canRemoveWhitespace ( char left, char beforeWSpace, char right, const LangOptions & LangOpts ) static