Skip to content

Commit 5203053

Browse files
committed
[embedded] Don't add functions twice; fix a typo.
1 parent 09edae3 commit 5203053

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

SwiftCompilerSources/Sources/Optimizer/ModulePasses/MandatoryPerformanceOptimizations.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ let mandatoryPerformanceOptimizations = ModulePass(name: "mandatory-performance-
3030
(moduleContext: ModulePassContext) in
3131

3232
var worklist = FunctionWorklist()
33-
worklist.addAllPerformanceAnnotatedFunctions(of: moduleContext)
34-
worklist.addAllAnnotatedGlobalInitOnceFunctions(of: moduleContext)
3533
// For embedded Swift, optimize all the functions (there cannot be any
3634
// generics, type metadata, etc.)
3735
if moduleContext.options.enableEmbeddedSwift {
3836
worklist.addAllNonGenericFunctions(of: moduleContext)
37+
} else {
38+
worklist.addAllPerformanceAnnotatedFunctions(of: moduleContext)
39+
worklist.addAllAnnotatedGlobalInitOnceFunctions(of: moduleContext)
3940
}
4041

4142
optimizeFunctionsTopDown(using: &worklist, moduleContext)

include/swift/SIL/RuntimeEffect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ enum class RuntimeEffect : unsigned {
5252
/// The runtime function calls ObjectiveC methods.
5353
ObjectiveC = 0x40,
5454

55-
/// Witness methods, boxing, unboxing, itializting, etc.
55+
/// Witness methods, boxing, unboxing, initializing, etc.
5656
Existential = 0x80,
5757

5858
/// Not modelled currently.

0 commit comments

Comments
 (0)