Skip to content

Commit 995e178

Browse files
committed
parents of friends are namespaced
1 parent 9d17ff9 commit 995e178

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

source/lib/AST/Serialize.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,8 @@ build(
10591059
getParent(id, D);
10601060
RecordInfo P(id);
10611061
P.Friends.emplace_back(I.id);
1062+
bool isInAnonymous;
1063+
getParentNamespaces(P.Namespace, ND, isInAnonymous);
10621064
return {
10631065
serialize(I),
10641066
serializeParent(std::move(I)),

source/lib/Metadata/Record.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ merge(RecordInfo&& Other)
5656
if(! Other.Friends.empty())
5757
{
5858
llvm::append_range(Friends, std::move(Other.Friends));
59+
llvm::sort(Friends,
60+
[](SymbolID const& id0, SymbolID const& id1)
61+
{
62+
return id0 < id1;
63+
});
64+
auto last = std::unique(Friends.begin(), Friends.end());
65+
Friends.erase(last, Friends.end());
5966
}
6067
}
6168

0 commit comments

Comments
 (0)