File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -461,7 +461,14 @@ class Instrumenter : InstrumenterBase {
461
461
}
462
462
} else if (auto *AE = dyn_cast<ApplyExpr>(E)) {
463
463
bool Handled = false ;
464
- if (auto *DRE = dyn_cast<DeclRefExpr>(AE->getFn ())) {
464
+ DeclRefExpr *DRE = nullptr ;
465
+ // With Swift 6 the print() function decl is a sub expression
466
+ // of a function conversion expression.
467
+ if (auto *FCE = dyn_cast<FunctionConversionExpr>(AE->getFn ()))
468
+ DRE = dyn_cast<DeclRefExpr>(FCE->getSubExpr ());
469
+ else
470
+ DRE = dyn_cast<DeclRefExpr>(AE->getFn ());
471
+ if (DRE) {
465
472
auto *FnD = dyn_cast<AbstractFunctionDecl>(DRE->getDecl ());
466
473
if (FnD && FnD->getModuleContext () == Context.TheStdlibModule ) {
467
474
DeclBaseName FnName = FnD->getBaseName ();
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: cp %s %t/main.swift
3
3
// RUN: %target-build-swift -whole-module-optimization -module-name PlaygroundSupport -emit-module-path %t/PlaygroundSupport.swiftmodule -parse-as-library -c -o %t/PlaygroundSupport.o %S/Inputs/SilentPCMacroRuntime.swift %S/Inputs/PlaygroundsRuntime.swift
4
+ //
5
+ // Default Swift version
4
6
// RUN: %target-build-swift -Xfrontend -playground -o %t/main -I=%t %t/PlaygroundSupport.o %t/main.swift
5
7
// RUN: %target-codesign %t/main
6
8
// RUN: %target-run %t/main | %FileCheck %s
7
9
// RUN: %target-build-swift -Xfrontend -pc-macro -Xfrontend -playground -o %t/main2 -I=%t %t/PlaygroundSupport.o %t/main.swift
8
10
// RUN: %target-codesign %t/main2
9
11
// RUN: %target-run %t/main2 | %FileCheck %s
12
+ //
13
+ // Swift version 6
14
+ // RUN: %target-build-swift -swift-version 6 -Xfrontend -playground -o %t/main3 -I=%t %t/PlaygroundSupport.o %t/main.swift
15
+ // RUN: %target-codesign %t/main3
16
+ // RUN: %target-run %t/main3 | %FileCheck %s
17
+ // RUN: %target-build-swift -swift-version 6 -Xfrontend -pc-macro -Xfrontend -playground -o %t/main4 -I=%t %t/PlaygroundSupport.o %t/main.swift
18
+ // RUN: %target-codesign %t/main4
19
+ // RUN: %target-run %t/main4 | %FileCheck %s
10
20
// REQUIRES: executable_test
11
21
12
22
import PlaygroundSupport
You can’t perform that action at this time.
0 commit comments