зеркало из https://github.com/microsoft/clang-1.git
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:
Родитель
0750618b0b
Коммит
68072a7f22
|
@ -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 =
|
||||
|
@ -535,6 +542,8 @@ SelectorTable* SelectorTable::CreateAndRegister(llvm::Deserializer& D) {
|
|||
nKeys*sizeof(IdentifierInfo *));
|
||||
|
||||
new (SI) MultiKeywordSelector(nKeys);
|
||||
|
||||
D.RegisterPtr(PtrID,SI);
|
||||
|
||||
IdentifierInfo **KeyInfo = reinterpret_cast<IdentifierInfo **>(SI+1);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче