[IDE/ModuleInterface] Fix erroneously printed newline between a regular comment and the declaration it is 'attached' to.

Swift SVN r16293
This commit is contained in:
Argyrios Kyrtzidis
2014-04-14 03:28:05 +00:00
parent 5293ec9581
commit 31a620f1ee
5 changed files with 27 additions and 2 deletions

View File

@@ -362,7 +362,8 @@ void ClangCommentPrinter::printCommentsUntil(ClangNode Node) {
const auto &Ctx = ClangLoader.getClangASTContext();
const auto &SM = Ctx.getSourceManager();
clang::SourceLocation NodeLoc = SM.getFileLoc(Node.getLocation());
clang::SourceLocation NodeLoc =
SM.getFileLoc(Node.getSourceRange().getBegin());
if (NodeLoc.isInvalid())
return;
unsigned NodeLineNo = SM.getSpellingLineNumber(NodeLoc);
@@ -424,7 +425,8 @@ void ClangCommentPrinter::printCommentsUntil(ClangNode Node) {
}
*this << CommentText << "\n";
printIndent();
LastPrintedCommentLineNo = LineNo;
LastPrintedCommentLineNo =
SM.getLineNumber(LocInfo.first, LocInfo.second + Tok.getLength());
} while (true);