Skip to content

Commit 87ecf5c

Browse files
committed
[embedded] Add explaining comment about location-less SIL functions in PerformanceDiagnostics
1 parent b217e31 commit 87ecf5c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/SILOptimizer/Mandatory/PerformanceDiagnostics.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,10 @@ class PerformanceDiagnosticsPass : public SILModuleTransform {
810810
SmallVector<SILFunction *, 8> constructorsAndDestructors;
811811

812812
for (SILFunction &function : *module) {
813+
// There might be SILFunctions without a location, e.g.
814+
// swift_readAtKeyPath generated by SILGen for keypaths. It's okay to
815+
// skip the ctor/dtor/method detection logic for those, such functions
816+
// still end up in the "others" list and are still visited.
813817
if (function.hasLocation()) {
814818
auto func =
815819
function.getLocation().getAsASTNode<AbstractFunctionDecl>();

0 commit comments

Comments
 (0)