aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-07-06 18:19:34 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-07-06 18:19:34 +0000
commit811c820257746b1799b790b6adc7804f44154011 (patch)
treea96d9155255424ea05b15f5428216a507daa63bb /lib/Serialization/ASTWriter.cpp
parent814e219fc6d5faeb48e4fd5375843346f2d4a7a7 (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.cpp14
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();