Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/SIL/Utils/OptimizationRemark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static bool hasForceEmitSemanticAttr(SILFunction &fn, StringRef passName) {
}

static bool isMethodWithForceEmitSemanticAttrNominalType(SILFunction &fn) {
if (!fn.hasSelfParam())
if (!fn.hasSelfParam() || fn.getArguments().empty())
return false;

auto selfType = fn.getSelfArgument()->getType();
Expand Down
5 changes: 5 additions & 0 deletions test/SILOptimizer/performance-annotations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,8 @@ func closueWhichModifiesLocalVar() -> Int {
return x
}

@_noAllocation
func createEmptyArray() {
_ = [Int]() // expected-error {{ending the lifetime of a value of type}}
}