[IDE] Search all comments for 'FIXME:', 'TODO:', 'MARK:' and report them in the syntax model.

Swift SVN r19423
This commit is contained in:
Argyrios Kyrtzidis
2014-07-01 19:21:16 +00:00
parent 40e6416448
commit e64821d268
6 changed files with 152 additions and 39 deletions

View File

@@ -114,12 +114,14 @@ unsigned SourceManager::getByteDistance(SourceLoc Start, SourceLoc End) const {
return End.Value.getPointer() - Start.Value.getPointer();
}
StringRef SourceManager::extractText(CharSourceRange Range) const {
StringRef SourceManager::extractText(CharSourceRange Range,
Optional<unsigned> BufferID) const {
assert(Range.isValid() && "range should be valid");
unsigned BufferID = findBufferContainingLoc(Range.getStart());
StringRef Buffer = LLVMSourceMgr.getMemoryBuffer(BufferID)->getBuffer();
return Buffer.substr(getLocOffsetInBuffer(Range.getStart(), BufferID),
if (!BufferID)
BufferID = findBufferContainingLoc(Range.getStart());
StringRef Buffer = LLVMSourceMgr.getMemoryBuffer(*BufferID)->getBuffer();
return Buffer.substr(getLocOffsetInBuffer(Range.getStart(), *BufferID),
Range.getByteLength());
}