[cfe-commits] r44483 - /cfe/trunk/Basic/IdentifierTable.cpp

Ted Kremenek kremenek at apple.com
Fri Nov 30 20:43:17 PST 2007


Author: kremenek
Date: Fri Nov 30 22:43:17 2007
New Revision: 44483

URL: http://llvm.org/viewvc/llvm-project?rev=44483&view=rev
Log:
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.

Modified:
    cfe/trunk/Basic/IdentifierTable.cpp

Modified: cfe/trunk/Basic/IdentifierTable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Basic/IdentifierTable.cpp?rev=44483&r1=44482&r2=44483&view=diff

==============================================================================
--- cfe/trunk/Basic/IdentifierTable.cpp (original)
+++ cfe/trunk/Basic/IdentifierTable.cpp Fri Nov 30 22:43:17 2007
@@ -507,7 +507,12 @@
   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 @@
     *static_cast<llvm::FoldingSet<MultiKeywordSelector>*>(t->Impl);
 
   while (!D.FinishedBlock(BLoc)) {
+
+    llvm::SerializedPtrID PtrID = D.ReadPtrID();
     unsigned nKeys = D.ReadInt();
     
     MultiKeywordSelector *SI = 
@@ -535,6 +542,8 @@
                                     nKeys*sizeof(IdentifierInfo *));
 
     new (SI) MultiKeywordSelector(nKeys);
+    
+    D.RegisterPtr(PtrID,SI);
 
     IdentifierInfo **KeyInfo = reinterpret_cast<IdentifierInfo **>(SI+1);
 





More information about the cfe-commits mailing list