[modules] Store offset to LOCAL_REDECLARATIONS record relative to the current
record rather than relative to the start of the bitcode file. Saves a couple of
bytes per LOCAL_REDECLARATIONS record (also makes diffs of llvm-bcanalyzer
output more useful when tracking down nondeterminism...).
llvm-svn: 264359
diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp
index 6c81b9e..e22a94d 100644
--- a/clang/lib/Serialization/ASTWriterDecl.cpp
+++ b/clang/lib/Serialization/ASTWriterDecl.cpp
@@ -1624,8 +1624,9 @@
if (LocalRedecls.empty())
Record.push_back(0);
else {
- Record.push_back(Writer.Stream.GetCurrentBitNo());
+ auto Start = Writer.Stream.GetCurrentBitNo();
Writer.Stream.EmitRecord(LOCAL_REDECLARATIONS, LocalRedecls);
+ Record.push_back(Writer.Stream.GetCurrentBitNo() - Start);
}
} else {
Record.push_back(0);