[IDE] Honor #sourceLocation in comment-to-XML conversion

This commit is contained in:
Jordan Rose
2018-08-29 09:06:54 -07:00
parent 11bddb49a0
commit 933bee62da
2 changed files with 8 additions and 2 deletions

View File

@@ -317,8 +317,7 @@ void CommentToXMLConverter::visitDocComment(const DocComment *DC) {
auto Loc = D->getLoc();
if (Loc.isValid()) {
const auto &SM = D->getASTContext().SourceMgr;
unsigned BufferID = SM.findBufferContainingLoc(Loc);
StringRef FileName = SM.getIdentifierForBuffer(BufferID);
StringRef FileName = SM.getDisplayNameForLoc(Loc);
auto LineAndColumn = SM.getLineAndColumn(Loc);
OS << " file=\"";
appendWithXMLEscaping(OS, FileName);