summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHReader.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-28 21:32:13 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-28 21:32:13 +0000
commitb925652433ce284600e9986ac75b4aa1e1b98e2f (patch)
treee18e3ffbbc4be4ad570f15ffa81b0a529d1dd695 /clang/lib/Frontend/PCHReader.cpp
parent1d583f28387ba092bd30f1109bd805248e3070e4 (diff)
downloadbcm5719-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/PCHReader.cpp')
-rw-r--r--clang/lib/Frontend/PCHReader.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp
index 64929dcb1db..4e3f50db2e6 100644
--- a/clang/lib/Frontend/PCHReader.cpp
+++ b/clang/lib/Frontend/PCHReader.cpp
@@ -237,7 +237,7 @@ public:
return II;
}
- uint32_t Bits = ReadUnalignedLE32(d);
+ unsigned Bits = ReadUnalignedLE16(d);
bool CPlusPlusOperatorKeyword = Bits & 0x01;
Bits >>= 1;
bool Poisoned = Bits & 0x01;
@@ -248,11 +248,9 @@ public:
Bits >>= 1;
unsigned ObjCOrBuiltinID = Bits & 0x3FF;
Bits >>= 10;
- unsigned TokenID = Bits & 0xFF;
- Bits >>= 8;
assert(Bits == 0 && "Extra bits in the identifier?");
- DataLen -= 8;
+ DataLen -= 6;
// Build the IdentifierInfo itself and link the identifier ID with
// the new IdentifierInfo.
@@ -264,9 +262,6 @@ public:
// Set or check the various bits in the IdentifierInfo structure.
// FIXME: Load token IDs lazily, too?
- assert((unsigned)II->getTokenID() == TokenID &&
- "Incorrect token ID loaded");
- (void)TokenID;
II->setObjCOrBuiltinID(ObjCOrBuiltinID);
assert(II->isExtensionToken() == ExtensionToken &&
"Incorrect extension token flag");
@@ -279,9 +274,9 @@ public:
// If this identifier is a macro, deserialize the macro
// definition.
if (hasMacroDefinition) {
- uint32_t Offset = ReadUnalignedLE64(d);
+ uint32_t Offset = ReadUnalignedLE32(d);
Reader.ReadMacroRecord(Offset);
- DataLen -= 8;
+ DataLen -= 4;
}
// Read all of the declarations visible at global scope with this
OpenPOWER on IntegriCloud