File tree Expand file tree Collapse file tree 3 files changed +4
-18
lines changed
include/clang/Serialization Expand file tree Collapse file tree 3 files changed +4
-18
lines changed Original file line number Diff line number Diff line change @@ -1392,19 +1392,8 @@ class ASTReader
13921392
13931393 llvm::DenseMap<const Decl *, bool > DefinitionSource;
13941394
1395- // / The set of extra flags about declarations that we have read from
1396- // / the module file.
1397- struct ExternalDeclarationBits {
1398- // / Indicates if given function declaration was a definition but its body
1399- // / was removed due to declaration merging.
1400- bool ThisDeclarationWasADefinition : 1 ;
1401-
1402- ExternalDeclarationBits () : ThisDeclarationWasADefinition(false ) {}
1403- };
1404-
1405- // / A mapping from declarations to extra bits of information about this decl.
1406- llvm::DenseMap<const Decl *, ExternalDeclarationBits>
1407- ExternalDeclarationBitsMap;
1395+ // / Friend functions that were defined but might have had their bodies removed.
1396+ llvm::DenseSet<const FunctionDecl *> ThisDeclarationWasADefinitionSet;
14081397
14091398 bool shouldDisableValidationForFile (const serialization::ModuleFile &M) const ;
14101399
Original file line number Diff line number Diff line change @@ -9661,10 +9661,7 @@ ExternalASTSource::ExtKind ASTReader::hasExternalDefinitions(const Decl *FD) {
96619661}
96629662
96639663bool ASTReader::wasThisDeclarationADefinition (const FunctionDecl *FD) {
9664- auto I = ExternalDeclarationBitsMap.find (FD);
9665- if (I == ExternalDeclarationBitsMap.end ())
9666- return false ;
9667- return I->second .ThisDeclarationWasADefinition ;
9664+ return ThisDeclarationWasADefinitionSet.contains (FD);
96689665}
96699666
96709667Selector ASTReader::getLocalSelector (ModuleFile &M, unsigned LocalID) {
Original file line number Diff line number Diff line change @@ -525,7 +525,7 @@ void ASTDeclReader::ReadFunctionDefinition(FunctionDecl *FD) {
525525 Reader.PendingBodies [FD] = GetCurrentCursorOffset ();
526526 // For now remember ThisDeclarationWasADefinition only for friend functions.
527527 if (FD->getFriendObjectKind ())
528- Reader.ExternalDeclarationBitsMap [FD]. ThisDeclarationWasADefinition = true ;
528+ Reader.ThisDeclarationWasADefinitionSet . insert (FD) ;
529529}
530530
531531void ASTDeclReader::Visit (Decl *D) {
You can’t perform that action at this time.
0 commit comments