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 | 7dd29d4d3d1c2fdcb4917d4121c3352650f83d38 (patch) | |
tree | d3320e7aac5933cddbbcdeaf18830fe6725f7ce2 /clang/lib/Serialization/ASTWriter.cpp | |
parent | a98fde5d70e615e3f8189243399e20b2aa59cd39 (diff) | |
download | bcm5719-llvm-7dd29d4d3d1c2fdcb4917d4121c3352650f83d38.tar.gz bcm5719-llvm-7dd29d4d3d1c2fdcb4917d4121c3352650f83d38.zip |
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.
llvm-svn: 159845
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 8ab17374724..566c8b77f5e 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/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(); |