Skip to content

Commit a416b11

Browse files
authored
Merge pull request #3677 from swiftwasm/main
[pull] swiftwasm from main
2 parents 9ac80ce + eabfce9 commit a416b11

File tree

5 files changed

+56
-6
lines changed

5 files changed

+56
-6
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,6 +2034,15 @@ int swift::performFrontend(ArrayRef<const char *> Args,
20342034
return finishDiagProcessing(1, /*verifierEnabled*/ false);
20352035
}
20362036

2037+
// Don't ask clients to report bugs when running a script in immediate mode.
2038+
// When a script asserts the compiler reports the error with the same
2039+
// stacktrace as a compiler crash. From here we can't tell which is which,
2040+
// for now let's not explicitly ask for bug reports.
2041+
if (Invocation.getFrontendOptions().RequestedAction ==
2042+
FrontendOptions::ActionType::Immediate) {
2043+
llvm::setBugReportMsg(nullptr);
2044+
}
2045+
20372046
PrettyStackTraceFrontend frontendTrace(Invocation.getLangOptions());
20382047

20392048
// Make an array of PrettyStackTrace objects to dump the configuration files

lib/SIL/IR/SILFunctionType.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2203,8 +2203,13 @@ static CanSILFunctionType getSILFunctionType(
22032203

22042204
// Lower the capture context parameters, if any.
22052205
if (constant && constant->getAnyFunctionRef()) {
2206+
// Lower in the context of the closure. Since the set of captures is a
2207+
// private contract between the closure and its enclosing context, we
2208+
// don't need to keep its capture types opaque.
22062209
auto expansion = TypeExpansionContext::maximal(
2207-
expansionContext.getContext(), expansionContext.isWholeModuleContext());
2210+
constant->getAnyFunctionRef()->getAsDeclContext(), false);
2211+
// ...unless it's inlinable, in which case it might get inlined into
2212+
// some place we need to keep opaque types opaque.
22082213
if (constant->isSerialized())
22092214
expansion = TypeExpansionContext::minimal();
22102215
lowerCaptureContextParameters(TC, *constant, genericSig, expansion, inputs);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// Don't ask to file a bug report on a script failure.
2+
3+
// REQUIRES: swift_interpreter
4+
5+
// RUN: not --crash %target-swift-frontend -interpret %s 2>&1 | %FileCheck %s
6+
7+
assert(false)
8+
// CHECK: Assertion failed
9+
// CHECK-NOT: Please submit a bug report

test/Interop/Cxx/stdlib/std-module-interface.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
// RUN: %target-swift-ide-test -print-module -module-to-print=std.string -source-filename=x -enable-cxx-interop -tools-directory=%llvm_obj_root/bin -module-cache-path %t | %FileCheck %s -check-prefix=CHECK-STRING
44

55
// Clang driver on Windows doesn't support -stdlib=libc++
6-
// XFAIL: OS=windows-msvc
6+
// UNSUPPORTED: OS=windows-msvc
77

8-
// libstdc++ cannot currently be imported.
9-
// XFAIL: OS=linux-gnu
8+
// libstdc++ cannot currently be imported
9+
// UNSUPPORTED: OS=linux-gnu
10+
// UNSUPPORTED: OS=linux-androideabi
11+
// UNSUPPORTED: OS=linux-android
1012

11-
// XFAIL: OS=linux-androideabi
12-
// XFAIL: OS=linux-android
13+
// REQUIRES: rdar84036022
1314

1415
// CHECK-STD: import std.iosfwd
1516
// CHECK-STD: import std.string
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// RUN: %target-swift-emit-silgen -disable-availability-checking -verify %s
2+
// rdar://83378116
3+
4+
public protocol P {}
5+
public protocol Q {}
6+
7+
struct SP<T: P>: P { init(t: T) {} }
8+
struct SQ: Q {}
9+
10+
struct Tubb<C: Q, T, F> {
11+
}
12+
13+
extension Tubb: P where T: P, F: P {
14+
init(c: C, t: () -> T, f: () -> F) {}
15+
}
16+
17+
struct SP2: P {}
18+
19+
func bar() -> some P { return SP2() }
20+
21+
public struct Butt {
22+
public func foo() -> some P {
23+
let sp = SP(t: bar())
24+
return Tubb(c: SQ(), t: { sp }, f: { sp })
25+
}
26+
}

0 commit comments

Comments
 (0)