Lines Matching refs:SourceLine
69 static int bytesSincePreviousTabOrLineBegin(StringRef SourceLine, size_t i) { in bytesSincePreviousTabOrLineBegin() argument
72 if (SourceLine[--i]=='\t') in bytesSincePreviousTabOrLineBegin()
99 printableTextForNextCharacter(StringRef SourceLine, size_t *i, in printableTextForNextCharacter() argument
102 assert(*i<SourceLine.size() && "must point to a valid index"); in printableTextForNextCharacter()
104 if (SourceLine[*i]=='\t') { in printableTextForNextCharacter()
107 unsigned col = bytesSincePreviousTabOrLineBegin(SourceLine, *i); in printableTextForNextCharacter()
119 begin = reinterpret_cast<unsigned char const *>(&*(SourceLine.begin() + *i)); in printableTextForNextCharacter()
120 end = begin + (SourceLine.size() - *i); in printableTextForNextCharacter()
126 unsigned char const *cp_end = begin+getNumBytesForUTF8(SourceLine[*i]); in printableTextForNextCharacter()
155 unsigned char byte = SourceLine[*i]; in printableTextForNextCharacter()
162 static void expandTabs(std::string &SourceLine, unsigned TabStop) { in expandTabs() argument
163 size_t i = SourceLine.size(); in expandTabs()
166 if (SourceLine[i]!='\t') in expandTabs()
170 = printableTextForNextCharacter(SourceLine, &tmp_i, TabStop); in expandTabs()
171 SourceLine.replace(i, 1, res.first.c_str()); in expandTabs()
197 static void byteToColumn(StringRef SourceLine, unsigned TabStop, in byteToColumn() argument
201 if (SourceLine.empty()) { in byteToColumn()
206 out.resize(SourceLine.size()+1, -1); in byteToColumn()
210 while (i<SourceLine.size()) { in byteToColumn()
213 = printableTextForNextCharacter(SourceLine, &i, TabStop); in byteToColumn()
231 static void columnToByte(StringRef SourceLine, unsigned TabStop, in columnToByte() argument
235 if (SourceLine.empty()) { in columnToByte()
242 while (i<SourceLine.size()) { in columnToByte()
246 = printableTextForNextCharacter(SourceLine, &i, TabStop); in columnToByte()
255 SourceColumnMap(StringRef SourceLine, unsigned TabStop) in SourceColumnMap()
256 : m_SourceLine(SourceLine) { in SourceColumnMap()
258 ::byteToColumn(SourceLine, TabStop, m_byteToColumn); in SourceColumnMap()
259 ::columnToByte(SourceLine, TabStop, m_columnToByte); in SourceColumnMap()
261 assert(m_byteToColumn.size()==SourceLine.size()+1); in SourceColumnMap()
321 static void selectInterestingSourceRegion(std::string &SourceLine, in selectInterestingSourceRegion() argument
416 while (SourceStart>0 || SourceEnd<SourceLine.size()) { in selectInterestingSourceRegion()
425 while (NewStart && isWhitespace(SourceLine[NewStart])) in selectInterestingSourceRegion()
431 if (isWhitespace(SourceLine[Prev])) in selectInterestingSourceRegion()
445 if (SourceEnd<SourceLine.size()) { in selectInterestingSourceRegion()
451 while (NewEnd < SourceLine.size() && isWhitespace(SourceLine[NewEnd])) in selectInterestingSourceRegion()
455 while (NewEnd < SourceLine.size() && isWhitespace(SourceLine[NewEnd])) in selectInterestingSourceRegion()
484 = map.byteToColumn(SourceLine.size())-map.byteToColumn(SourceEnd); in selectInterestingSourceRegion()
494 SourceLine.replace(SourceEnd, std::string::npos, back_ellipse); in selectInterestingSourceRegion()
502 SourceLine.replace(0, SourceStart, front_ellipse); in selectInterestingSourceRegion()
1112 std::string SourceLine(LineStart, LineEnd); in emitSnippetAndCaret() local
1115 const SourceColumnMap sourceColMap(SourceLine, DiagOpts->TabStop); in emitSnippetAndCaret()
1142 selectInterestingSourceRegion(SourceLine, CaretLine, FixItInsertionLine, in emitSnippetAndCaret()
1150 SourceLine = ' ' + SourceLine; in emitSnippetAndCaret()
1159 emitSnippet(SourceLine); in emitSnippetAndCaret()