diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-28 21:32:13 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-28 21:32:13 +0000 |
commit | b925652433ce284600e9986ac75b4aa1e1b98e2f (patch) | |
tree | e18e3ffbbc4be4ad570f15ffa81b0a529d1dd695 /clang/lib/Frontend/PCHWriter.cpp | |
parent | 1d583f28387ba092bd30f1109bd805248e3070e4 (diff) | |
download | bcm5719-llvm-b925652433ce284600e9986ac75b4aa1e1b98e2f.tar.gz bcm5719-llvm-b925652433ce284600e9986ac75b4aa1e1b98e2f.zip |
Optimize IdentifierInfo storage within the precompiled header. We've
now gotten back about 180k of the 500k we lost.
llvm-svn: 70326
Diffstat (limited to 'clang/lib/Frontend/PCHWriter.cpp')
-rw-r--r-- | clang/lib/Frontend/PCHWriter.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp index 4870b4933a8..04b552a488e 100644 --- a/clang/lib/Frontend/PCHWriter.cpp +++ b/clang/lib/Frontend/PCHWriter.cpp @@ -1322,10 +1322,10 @@ public: unsigned KeyLen = strlen(II->getName()) + 1; unsigned DataLen = 4; // 4 bytes for the persistent ID << 1 if (isInterestingIdentifier(II)) { - DataLen += 4; // 4 bytes for token ID, builtin, flags + DataLen += 2; // 2 bytes for builtin ID, flags if (II->hasMacroDefinition() && !PP.getMacroInfo(const_cast<IdentifierInfo *>(II))->isBuiltinMacro()) - DataLen += 8; + DataLen += 4; for (IdentifierResolver::iterator D = IdentifierResolver::begin(II), DEnd = IdentifierResolver::end(); D != DEnd; ++D) @@ -1353,21 +1353,21 @@ public: clang::io::Emit32(Out, ID << 1); return; } + clang::io::Emit32(Out, (ID << 1) | 0x01); uint32_t Bits = 0; bool hasMacroDefinition = II->hasMacroDefinition() && !PP.getMacroInfo(const_cast<IdentifierInfo *>(II))->isBuiltinMacro(); - Bits = Bits | (uint32_t)II->getTokenID(); - Bits = (Bits << 10) | (uint32_t)II->getObjCOrBuiltinID(); + Bits = (uint32_t)II->getObjCOrBuiltinID(); Bits = (Bits << 1) | hasMacroDefinition; Bits = (Bits << 1) | II->isExtensionToken(); Bits = (Bits << 1) | II->isPoisoned(); Bits = (Bits << 1) | II->isCPlusPlusOperatorKeyword(); - clang::io::Emit32(Out, Bits); + clang::io::Emit16(Out, Bits); if (hasMacroDefinition) - clang::io::Emit64(Out, Writer.getMacroOffset(II)); + clang::io::Emit32(Out, Writer.getMacroOffset(II)); // Emit the declaration IDs in reverse order, because the // IdentifierResolver provides the declarations as they would be |