When printing SourceRanges, add an option to not print the text as well.

Swift SVN r6836
This commit is contained in:
Argyrios Kyrtzidis
2013-08-02 02:50:32 +00:00
parent cff4cf4e16
commit 99512e4220
2 changed files with 11 additions and 8 deletions

View File

@@ -54,7 +54,7 @@ void SourceLoc::dump(const SourceManager &SM) const {
}
void SourceRange::print(raw_ostream &OS, const SourceManager &SM,
int &LastBuffer) const {
int &LastBuffer, bool PrintText) const {
OS << '[';
Start.print(OS, SM, LastBuffer);
OS << " - ";
@@ -64,10 +64,12 @@ void SourceRange::print(raw_ostream &OS, const SourceManager &SM,
if (Start.isInvalid() || End.isInvalid())
return;
OS << " RangeText=\""
<< StringRef(Start.Value.getPointer(),
End.Value.getPointer() - Start.Value.getPointer()+1)
<< '"';
if (PrintText) {
OS << " RangeText=\""
<< StringRef(Start.Value.getPointer(),
End.Value.getPointer() - Start.Value.getPointer()+1)
<< '"';
}
}
void SourceRange::dump(const SourceManager &SM) const {