Teach the related-id checker to ignore things from other buffers

This commit is contained in:
Doug Gregor
2023-02-13 10:13:39 -08:00
parent b87dfdf2ae
commit a712c37c05
2 changed files with 13 additions and 1 deletions

View File

@@ -2398,6 +2398,10 @@ private:
}
bool passId(CharSourceRange Range) {
// FIXME: Ignore things that don't come from this buffer.
if (!SourceMgr.getRangeForBuffer(BufferID).contains(Range.getStart()))
return !Cancelled;
unsigned Offset = SourceMgr.getLocOffsetInBuffer(Range.getStart(),BufferID);
Ranges.insert({Offset, Range.getByteLength()});
return !Cancelled;