#include "TestSupport.h"
#include "clang/Basic/DiagnosticError.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/LineIterator.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Regex.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
usingnamespacellvm;
namespace clang {
namespace refactor {
void TestSelectionRangesInFile::dump(raw_ostream &OS) const { … }
bool TestSelectionRangesInFile::foreachRange(
const SourceManager &SM,
llvm::function_ref<void(SourceRange)> Callback) const { … }
namespace {
void dumpChanges(const tooling::AtomicChanges &Changes, raw_ostream &OS) { … }
bool areChangesSame(const tooling::AtomicChanges &LHS,
const tooling::AtomicChanges &RHS) { … }
bool printRewrittenSources(const tooling::AtomicChanges &Changes,
raw_ostream &OS) { … }
class TestRefactoringResultConsumer final
: public ClangRefactorToolConsumerInterface { … };
std::pair<unsigned, unsigned> getLineColumn(StringRef Filename,
unsigned Offset) { … }
}
bool TestRefactoringResultConsumer::handleAllResults() { … }
std::unique_ptr<ClangRefactorToolConsumerInterface>
TestSelectionRangesInFile::createConsumer() const { … }
static unsigned addColumnOffset(StringRef Source, unsigned Offset,
unsigned ColumnOffset) { … }
static unsigned addEndLineOffsetAndEndColumn(StringRef Source, unsigned Offset,
unsigned LineNumberOffset,
unsigned Column) { … }
std::optional<TestSelectionRangesInFile>
findTestSelectionRanges(StringRef Filename) { … }
}
}