diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-19 20:40:25 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-19 20:40:25 +0000 |
commit | 2dbaca748bc3eb6539f417bd8354c930bdf88fa4 (patch) | |
tree | dd761bb6948256b2dcb649f17768a74a0999c775 /lib/Serialization/ASTWriter.cpp | |
parent | a64ccefdf0ea4e03ec88805d71b0af74950c7472 (diff) |
Introduce PreprocessingRecord::getPreprocessedEntitiesInRange()
which will do a binary search and return a pair of iterators
for preprocessed entities in the given source range.
Source ranges of preprocessed entities are stored twice currently in
the PCH/Module file but this will be fixed in a subsequent commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140058 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | lib/Serialization/ASTWriter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 335ac3f07a..3227476ee9 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -1714,7 +1714,7 @@ void ASTWriter::WritePreprocessorDetail(PreprocessingRecord &PPRec) { if (PPRec.begin(Chain) == PPRec.end(Chain)) return; - SmallVector<uint32_t, 64> PreprocessedEntityOffsets; + SmallVector<PPEntityOffset, 64> PreprocessedEntityOffsets; // Enter the preprocessor block. Stream.EnterSubblock(PREPROCESSOR_DETAIL_BLOCK_ID, 3); @@ -1750,7 +1750,8 @@ void ASTWriter::WritePreprocessorDetail(PreprocessingRecord &PPRec) { (void)++E, ++NumPreprocessingRecords, ++NextPreprocessorEntityID) { Record.clear(); - PreprocessedEntityOffsets.push_back(Stream.GetCurrentBitNo()); + PreprocessedEntityOffsets.push_back(PPEntityOffset((*E)->getSourceRange(), + Stream.GetCurrentBitNo())); if (MacroDefinition *MD = dyn_cast<MacroDefinition>(*E)) { // Record this macro definition's ID. |