Comment parsing: allow parsing comments with invalid source locations -- these

come from serialized modules


Swift SVN r15104
This commit is contained in:
Dmitri Hrybenko
2014-03-15 14:58:29 +00:00
parent 9583261228
commit c1d96e579e
3 changed files with 22 additions and 18 deletions

View File

@@ -50,6 +50,12 @@ public:
llvm::SMLoc::getFromPointer(Value.getPointer() + ByteOffset));
}
SourceLoc getAdvancedLocOrInvalid(int ByteOffset) const {
if (isValid())
return getAdvancedLoc(ByteOffset);
return SourceLoc();
}
/// Print out the SourceLoc. If this location is in the same buffer
/// as specified by \c LastBufferID, then we don't print the filename. If
/// not, we do print the filename, and then update \c LastBufferID with the