aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r--lib/Serialization/ASTWriter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp
index aaf4678ba2..e6e88f8f87 100644
--- a/lib/Serialization/ASTWriter.cpp
+++ b/lib/Serialization/ASTWriter.cpp
@@ -1803,6 +1803,7 @@ void ASTWriter::WritePreprocessorDetail(PreprocessingRecord &PPRec) {
unsigned IndexBase = Chain ? PPRec.getNumLoadedPreprocessedEntities() : 0;
RecordData Record;
+ uint64_t BitsInChain = Chain? Chain->TotalModulesSizeInBits : 0;
for (PreprocessingRecord::iterator E = PPRec.begin(Chain),
EEnd = PPRec.end(Chain);
E != EEnd; ++E) {
@@ -1819,7 +1820,7 @@ void ASTWriter::WritePreprocessorDetail(PreprocessingRecord &PPRec) {
// Notify the serialization listener that we're serializing this entity.
if (SerializationListener)
SerializationListener->SerializedPreprocessedEntity(*E,
- Stream.GetCurrentBitNo());
+ BitsInChain + Stream.GetCurrentBitNo());
unsigned Position = ID - FirstMacroID;
if (Position != MacroDefinitionOffsets.size()) {
@@ -1843,7 +1844,7 @@ void ASTWriter::WritePreprocessorDetail(PreprocessingRecord &PPRec) {
// Notify the serialization listener that we're serializing this entity.
if (SerializationListener)
SerializationListener->SerializedPreprocessedEntity(*E,
- Stream.GetCurrentBitNo());
+ BitsInChain + Stream.GetCurrentBitNo());
if (MacroExpansion *ME = dyn_cast<MacroExpansion>(*E)) {
Record.push_back(IndexBase + NumPreprocessingRecords++);