summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReader.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2014-03-27 15:40:39 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2014-03-27 15:40:39 +0000
commit9ee0e303d68054a8fdb1b071a7de6ddcc8b9ecd9 (patch)
tree74283e009b02f845e8f8b0d14cba0ef054a81666 /clang/lib/Serialization/ASTReader.cpp
parenta39fc6dd2afab9cb14286e00f2f6ef2370002c40 (diff)
downloadbcm5719-llvm-9ee0e303d68054a8fdb1b071a7de6ddcc8b9ecd9.tar.gz
bcm5719-llvm-9ee0e303d68054a8fdb1b071a7de6ddcc8b9ecd9.zip
Comment parsing: when comment ranges are deserialized from multiple modules,
correctly order comments in SourceManager::isBeforeInTranslationUnit() order Unfortunately, this is not as simple as it was implemented previously, and actually requires doing a merge sort. llvm-svn: 204936
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index fc8c030833e..311a403f44e 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -7688,6 +7688,7 @@ void ASTReader::ReadComments() {
I = CommentsCursors.begin(),
E = CommentsCursors.end();
I != E; ++I) {
+ Comments.clear();
BitstreamCursor &Cursor = I->first;
serialization::ModuleFile &F = *I->second;
SavedStreamPosition SavedPosition(Cursor);
@@ -7696,7 +7697,7 @@ void ASTReader::ReadComments() {
while (true) {
llvm::BitstreamEntry Entry =
Cursor.advanceSkippingSubblocks(BitstreamCursor::AF_DontPopBlockAtEnd);
-
+
switch (Entry.Kind) {
case llvm::BitstreamEntry::SubBlock: // Handled for us already.
case llvm::BitstreamEntry::Error:
@@ -7726,9 +7727,9 @@ void ASTReader::ReadComments() {
}
}
}
- NextCursor:;
+ NextCursor:
+ Context.Comments.addDeserializedComments(Comments);
}
- Context.Comments.addCommentsToFront(Comments);
}
void ASTReader::finishPendingActions() {
OpenPOWER on IntegriCloud