Fixed bug in the serialization of SelectorTable where we did not register the

pointer of MultiKeywordSelectors.

Added optimization to the serialization of SelectorTable where we only serialize
out MultiKeywordSelectors that are ever referenced by an object other than the
SelectorTable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44483 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek 2007-12-01 04:43:17 +00:00
Родитель 0750618b0b
Коммит 68072a7f22
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -507,7 +507,12 @@ void SelectorTable::Emit(llvm::Serializer& S) const {
S.EmitPtr(this);
for (iterator I=SelTab->begin(), E=SelTab->end(); I != E; ++I) {
if (!S.isRegistered(&*I))
continue;
S.FlushRecord(); // Start a new record.
S.EmitPtr(&*I);
S.EmitInt(I->getNumArgs());
for (MultiKeywordSelector::keyword_iterator KI = I->keyword_begin(),
@ -528,6 +533,8 @@ SelectorTable* SelectorTable::CreateAndRegister(llvm::Deserializer& D) {
*static_cast<llvm::FoldingSet<MultiKeywordSelector>*>(t->Impl);
while (!D.FinishedBlock(BLoc)) {
llvm::SerializedPtrID PtrID = D.ReadPtrID();
unsigned nKeys = D.ReadInt();
MultiKeywordSelector *SI =
@ -536,6 +543,8 @@ SelectorTable* SelectorTable::CreateAndRegister(llvm::Deserializer& D) {
new (SI) MultiKeywordSelector(nKeys);
D.RegisterPtr(PtrID,SI);
IdentifierInfo **KeyInfo = reinterpret_cast<IdentifierInfo **>(SI+1);
for (unsigned i = 0; i != nKeys; ++i)