forked from OSchip/llvm-project
parent
4ad81df818
commit
556ab5ee90
|
@ -40,7 +40,7 @@ static const enum raw_ostream::Colors savedColor =
|
||||||
/// \brief Number of spaces to indent when word-wrapping.
|
/// \brief Number of spaces to indent when word-wrapping.
|
||||||
const unsigned WordWrapIndentation = 6;
|
const unsigned WordWrapIndentation = 6;
|
||||||
|
|
||||||
int bytesSincePreviousTabOrLineBegin(StringRef SourceLine, size_t i) {
|
static int bytesSincePreviousTabOrLineBegin(StringRef SourceLine, size_t i) {
|
||||||
int bytes = 0;
|
int bytes = 0;
|
||||||
while (0<i) {
|
while (0<i) {
|
||||||
if (SourceLine[--i]=='\t')
|
if (SourceLine[--i]=='\t')
|
||||||
|
@ -69,7 +69,7 @@ int bytesSincePreviousTabOrLineBegin(StringRef SourceLine, size_t i) {
|
||||||
/// \param TabStop used to expand tabs
|
/// \param TabStop used to expand tabs
|
||||||
/// \return pair(printable text, 'true' iff original text was printable)
|
/// \return pair(printable text, 'true' iff original text was printable)
|
||||||
///
|
///
|
||||||
std::pair<SmallString<16>,bool>
|
static std::pair<SmallString<16>, bool>
|
||||||
printableTextForNextCharacter(StringRef SourceLine, size_t *i,
|
printableTextForNextCharacter(StringRef SourceLine, size_t *i,
|
||||||
unsigned TabStop) {
|
unsigned TabStop) {
|
||||||
assert(i && "i must not be null");
|
assert(i && "i must not be null");
|
||||||
|
@ -146,7 +146,7 @@ printableTextForNextCharacter(StringRef SourceLine, size_t *i,
|
||||||
return std::make_pair(expandedByte, false);
|
return std::make_pair(expandedByte, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void expandTabs(std::string &SourceLine, unsigned TabStop) {
|
static void expandTabs(std::string &SourceLine, unsigned TabStop) {
|
||||||
size_t i = SourceLine.size();
|
size_t i = SourceLine.size();
|
||||||
while (i>0) {
|
while (i>0) {
|
||||||
i--;
|
i--;
|
||||||
|
@ -181,8 +181,8 @@ void expandTabs(std::string &SourceLine, unsigned TabStop) {
|
||||||
///
|
///
|
||||||
/// (\u3042 is represented in UTF-8 by three bytes and takes two columns to
|
/// (\u3042 is represented in UTF-8 by three bytes and takes two columns to
|
||||||
/// display)
|
/// display)
|
||||||
void byteToColumn(StringRef SourceLine, unsigned TabStop,
|
static void byteToColumn(StringRef SourceLine, unsigned TabStop,
|
||||||
SmallVectorImpl<int> &out) {
|
SmallVectorImpl<int> &out) {
|
||||||
out.clear();
|
out.clear();
|
||||||
|
|
||||||
if (SourceLine.empty()) {
|
if (SourceLine.empty()) {
|
||||||
|
@ -215,7 +215,7 @@ void byteToColumn(StringRef SourceLine, unsigned TabStop,
|
||||||
///
|
///
|
||||||
/// (\u3042 is represented in UTF-8 by three bytes and takes two columns to
|
/// (\u3042 is represented in UTF-8 by three bytes and takes two columns to
|
||||||
/// display)
|
/// display)
|
||||||
void columnToByte(StringRef SourceLine, unsigned TabStop,
|
static void columnToByte(StringRef SourceLine, unsigned TabStop,
|
||||||
SmallVectorImpl<int> &out) {
|
SmallVectorImpl<int> &out) {
|
||||||
out.clear();
|
out.clear();
|
||||||
|
|
||||||
|
@ -934,8 +934,7 @@ void TextDiagnostic::emitSnippetAndCaret(
|
||||||
emitParseableFixits(Hints);
|
emitParseableFixits(Hints);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextDiagnostic::emitSnippet(StringRef line)
|
void TextDiagnostic::emitSnippet(StringRef line) {
|
||||||
{
|
|
||||||
if (line.empty())
|
if (line.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue