diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-03-24 23:41:14 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-03-24 23:41:14 +0000 |
commit | d07268c52832948e7d8cd61b53312aa0e14e93f8 (patch) | |
tree | f4c892244c259a08abd0ccb3cf003371cece7501 /clang/lib/Serialization/ASTWriterDecl.cpp | |
parent | 9dd8c146746a0435115a461bd19d9aede965800c (diff) | |
download | llvm-d07268c52832948e7d8cd61b53312aa0e14e93f8.zip llvm-d07268c52832948e7d8cd61b53312aa0e14e93f8.tar.gz llvm-d07268c52832948e7d8cd61b53312aa0e14e93f8.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/Serialization/ASTWriterDecl.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriterDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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 @@ void ASTDeclWriter::VisitRedeclarable(Redeclarable<T> *D) { 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); |