We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
getExtensionIndex
1 parent 826d7c7 commit 87c7387Copy full SHA for 87c7387
swift/extractor/mangler/SwiftMangler.cpp
@@ -103,6 +103,10 @@ SwiftMangledName SwiftMangler::visitExtensionDecl(const swift::ExtensionDecl* de
103
104
unsigned SwiftMangler::getExtensionIndex(const swift::ExtensionDecl* decl,
105
const swift::Decl* parent) {
106
+ // to avoid iterating multiple times on the parent of multiple extensions, we preload extension
107
+ // indexes once for each encountered parent into the `preloadedExtensionIndexes` mapping.
108
+ // Because we mangle declarations only once in a given trap/dispatcher context, we can safely
109
+ // discard preloaded indexes on use
110
if (auto found = preloadedExtensionIndexes.extract(decl)) {
111
return found.mapped();
112
}
0 commit comments