MCPcopy Create free account
hub / github.com/ablab/spades / printSourceLine

Function printSourceLine

ext/src/llvm/SourceMgr.cpp:425–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423}
424
425static void printSourceLine(raw_ostream &S, StringRef LineContents) {
426 // Print out the source line one character at a time, so we can expand tabs.
427 for (unsigned i = 0, e = LineContents.size(), OutCol = 0; i != e; ++i) {
428 size_t NextTab = LineContents.find('\t', i);
429 // If there were no tabs left, print the rest, we are done.
430 if (NextTab == StringRef::npos) {
431 S << LineContents.drop_front(i);
432 break;
433 }
434
435 // Otherwise, print from i to NextTab.
436 S << LineContents.slice(i, NextTab);
437 OutCol += NextTab - i;
438 i = NextTab;
439
440 // If we have a tab, emit at least one space, then round up to 8 columns.
441 do {
442 S << ' ';
443 ++OutCol;
444 } while ((OutCol % TabStop) != 0);
445 }
446 S << '\n';
447}
448
449static bool isNonASCII(char c) { return c & 0x80; }
450

Callers 1

printMethod · 0.85

Calls 4

sizeMethod · 0.45
findMethod · 0.45
drop_frontMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected