diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-07-06 18:19:34 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-07-06 18:19:34 +0000 |
commit | 811c820257746b1799b790b6adc7804f44154011 (patch) | |
tree | a96d9155255424ea05b15f5428216a507daa63bb /lib/Serialization/ASTWriter.cpp | |
parent | 814e219fc6d5faeb48e4fd5375843346f2d4a7a7 (diff) |
Don't store pointers into a std::vector (RawCommentList::Comments). Although
currently we take address of std::vector's contents only after we finished
adding all comments (so no reallocation can happen), this will change in
future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159845 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | lib/Serialization/ASTWriter.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 8ab1737472..566c8b77f5 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -2245,16 +2245,16 @@ void ASTWriter::WriteFileDeclIDsMap() { void ASTWriter::WriteComments() { Stream.EnterSubblock(COMMENTS_BLOCK_ID, 3); - ArrayRef<RawComment> RawComments = Context->Comments.getComments(); + ArrayRef<RawComment *> RawComments = Context->Comments.getComments(); RecordData Record; - for (ArrayRef<RawComment>::iterator I = RawComments.begin(), - E = RawComments.end(); + for (ArrayRef<RawComment *>::iterator I = RawComments.begin(), + E = RawComments.end(); I != E; ++I) { Record.clear(); - AddSourceRange(I->getSourceRange(), Record); - Record.push_back(I->getKind()); - Record.push_back(I->isTrailingComment()); - Record.push_back(I->isAlmostTrailingComment()); + AddSourceRange((*I)->getSourceRange(), Record); + Record.push_back((*I)->getKind()); + Record.push_back((*I)->isTrailingComment()); + Record.push_back((*I)->isAlmostTrailingComment()); Stream.EmitRecord(COMMENTS_RAW_COMMENT, Record); } Stream.ExitBlock(); |