diff options
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index 765655b..95b1661 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -344,7 +344,8 @@ PCHReader::PCHReader(Preprocessor &PP, ASTContext *Context) IdentifierOffsets(0), MethodPoolLookupTable(0), MethodPoolLookupTableData(0), TotalSelectorsInMethodPool(0), SelectorOffsets(0), - TotalNumSelectors(0), NumStatHits(0), NumStatMisses(0), + TotalNumSelectors(0), Comments(0), NumComments(0), + NumStatHits(0), NumStatMisses(0), NumSLocEntriesRead(0), NumStatementsRead(0), NumMacrosRead(0), NumMethodPoolSelectorsRead(0), NumMethodPoolMisses(0), NumLexicalDeclContextsRead(0), NumVisibleDeclContextsRead(0) { } @@ -1350,6 +1351,11 @@ PCHReader::ReadPCHBlock() { case pch::ORIGINAL_FILE_NAME: OriginalFileName.assign(BlobStart, BlobLen); break; + + case pch::COMMENT_RANGES: + Comments = (SourceRange *)BlobStart; + NumComments = BlobLen / sizeof(SourceRange); + break; } } Error("premature end of bitstream in PCH file"); @@ -1664,6 +1670,12 @@ bool PCHReader::ParseLanguageOptions( return false; } +void PCHReader::ReadComments(std::vector<SourceRange> &Comments) { + Comments.resize(NumComments); + std::copy(this->Comments, this->Comments + NumComments, + Comments.begin()); +} + /// \brief Read and return the type at the given offset. /// /// This routine actually reads the record corresponding to the type |