summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHWriter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-28 20:01:51 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-28 20:01:51 +0000
commitab4df58193b60455286db0cd4ad3e67b535cd3d6 (patch)
tree9c17b48790d655be5f6ca8cdb410472dad05fccb /clang/lib/Frontend/PCHWriter.cpp
parent3d948164f7319e3e45d40831ba9e73ce9f44f230 (diff)
downloadbcm5719-llvm-ab4df58193b60455286db0cd4ad3e67b535cd3d6.tar.gz
bcm5719-llvm-ab4df58193b60455286db0cd4ad3e67b535cd3d6.zip
Revert r70075 and r70078, which reorganized the PCH on-disk hash table
for identifiers to separate "interesting" from "uninteresting" identifiers. However, to cope with compiler invocations where the predefines buffers mismatch, we need to be able to search the complete identifier table. Cocoa.h.pch is now about 500k larger that it used to be :( llvm-svn: 70320
Diffstat (limited to 'clang/lib/Frontend/PCHWriter.cpp')
-rw-r--r--clang/lib/Frontend/PCHWriter.cpp39
1 files changed, 4 insertions, 35 deletions
diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp
index cd2021479ff..e61cca554bc 100644
--- a/clang/lib/Frontend/PCHWriter.cpp
+++ b/clang/lib/Frontend/PCHWriter.cpp
@@ -1318,12 +1318,10 @@ public:
DEnd = IdentifierResolver::end();
D != DEnd; ++D)
DataLen += sizeof(pch::DeclID);
- // We emit the key length after the data length so that the
- // "uninteresting" identifiers following the identifier hash table
- // structure will have the same (key length, key characters)
- // layout as the keys in the hash table. This also matches the
- // format for identifiers in pretokenized headers.
clang::io::Emit16(Out, DataLen);
+ // We emit the key length after the data length so that every
+ // string is preceded by a 16-bit length. This matches the PTH
+ // format for storing identifiers.
clang::io::Emit16(Out, KeyLen);
return std::make_pair(KeyLen, DataLen);
}
@@ -1384,33 +1382,12 @@ void PCHWriter::WriteIdentifierTable(Preprocessor &PP) {
{
OnDiskChainedHashTableGenerator<PCHIdentifierTableTrait> Generator;
- llvm::SmallVector<const IdentifierInfo *, 32> UninterestingIdentifiers;
-
// Create the on-disk hash table representation.
for (llvm::DenseMap<const IdentifierInfo *, pch::IdentID>::iterator
ID = IdentifierIDs.begin(), IDEnd = IdentifierIDs.end();
ID != IDEnd; ++ID) {
assert(ID->first && "NULL identifier in identifier table");
-
- // Classify each identifier as either "interesting" or "not
- // interesting". Interesting identifiers are those that have
- // additional information that needs to be read from the PCH
- // file, e.g., a built-in ID, declaration chain, or macro
- // definition. These identifiers are placed into the hash table
- // so that they can be found when looked up in the user program.
- // All other identifiers are "uninteresting", which means that
- // the IdentifierInfo built by default has all of the
- // information we care about. Such identifiers are placed after
- // the hash table.
- const IdentifierInfo *II = ID->first;
- if (II->isPoisoned() ||
- II->isExtensionToken() ||
- II->hasMacroDefinition() ||
- II->getObjCOrBuiltinID() ||
- II->getFETokenInfo<void>())
- Generator.insert(ID->first, ID->second);
- else
- UninterestingIdentifiers.push_back(II);
+ Generator.insert(ID->first, ID->second);
}
// Create the on-disk hash table in a buffer.
@@ -1422,14 +1399,6 @@ void PCHWriter::WriteIdentifierTable(Preprocessor &PP) {
// Make sure that no bucket is at offset 0
clang::io::Emit32(Out, 0);
BucketOffset = Generator.Emit(Out, Trait);
-
- for (unsigned I = 0, N = UninterestingIdentifiers.size(); I != N; ++I) {
- const IdentifierInfo *II = UninterestingIdentifiers[I];
- unsigned N = II->getLength() + 1;
- clang::io::Emit16(Out, N);
- SetIdentifierOffset(II, Out.tell());
- Out.write(II->getName(), N);
- }
}
// Create a blob abbreviation
OpenPOWER on IntegriCloud