Skip to content

Commit 1e4b75d

Browse files
committed
Parser: Don't skip nested protocols for LLDB
1 parent 6e03342 commit 1e4b75d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5625,7 +5625,8 @@ static unsigned skipUntilMatchingRBrace(Parser &P,
56255625
tok::pound_if, tok::pound_else, tok::pound_endif, tok::pound_elseif);
56265626

56275627
HasNestedTypeDeclarations |= P.Tok.isAny(tok::kw_class, tok::kw_struct,
5628-
tok::kw_enum, tok::kw_typealias)
5628+
tok::kw_enum, tok::kw_typealias,
5629+
tok::kw_protocol)
56295630
|| P.Tok.isContextualKeyword("actor");
56305631

56315632
// HACK: Bail if we encounter what could potentially be a regex literal.

test/Frontend/skip-function-bodies.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,16 @@ public func funcPublicWithNestedTypeActor() {
217217
// CHECK-SIL-SKIP-NONINLINE-NOT: "funcPublicWithNestedTypeActor()"
218218
// CHECK-SIL-SKIP-WITHOUTTYPES: "funcPublicWithNestedTypeActor()"
219219

220+
public func funcPublicWithNestedTypeProtocol() {
221+
let INLINENOTYPECHECK_local = "funcPublicWithNestedTypeProtocol()"
222+
_blackHole(INLINENOTYPECHECK_local)
223+
protocol P {}
224+
}
225+
// CHECK-TEXTUAL-NOT: "funcPublicWithNestedTypeProtocol()"
226+
// CHECK-SIL-NO-SKIP: "funcPublicWithNestedTypeProtocol()"
227+
// CHECK-SIL-SKIP-NONINLINE-NOT: "funcPublicWithNestedTypeProtocol()"
228+
// CHECK-SIL-SKIP-WITHOUTTYPES: "funcPublicWithNestedTypeProtocol()"
229+
220230
public func funcPublicWithNestedTypeStruct() {
221231
let INLINENOTYPECHECK_local = "funcPublicWithNestedTypeStruct()"
222232
_blackHole(INLINENOTYPECHECK_local)

0 commit comments

Comments
 (0)