Skip to content

Commit 0aa39e3

Browse files
authored
Merge pull request #62329 from tshortli/allow-has-symbol-on-linux
Sema: Lift restriction preventing use of `#_hasSymbol` on non-Darwin-platforms
2 parents 079369f + 164ac42 commit 0aa39e3

File tree

12 files changed

+9
-28
lines changed

12 files changed

+9
-28
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6719,8 +6719,6 @@ WARNING(has_symbol_decl_must_be_weak,none,
67196719
(DescriptiveDeclKind, DeclName))
67206720
ERROR(has_symbol_invalid_expr,none,
67216721
"'#_hasSymbol' condition must refer to a declaration", ())
6722-
ERROR(has_symbol_unsupported_on_target,none,
6723-
"'#_hasSymbol' is unsupported on target '%0'", (StringRef))
67246722

67256723
//------------------------------------------------------------------------------
67266724
// MARK: Type erasure

lib/Sema/MiscDiagnostics.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4506,15 +4506,6 @@ static bool diagnoseHasSymbolCondition(PoundHasSymbolInfo *info,
45064506
return false;
45074507

45084508
auto &ctx = DC->getASTContext();
4509-
if (!ctx.LangOpts.Target.isOSDarwin()) {
4510-
// SILGen for #_hasSymbol is currently implemented assuming the target OS
4511-
// is a Darwin platform.
4512-
ctx.Diags.diagnose(info->getStartLoc(),
4513-
diag::has_symbol_unsupported_on_target,
4514-
ctx.LangOpts.Target.str());
4515-
return true;
4516-
}
4517-
45184509
auto decl = info->getReferencedDecl().getDecl();
45194510
if (!decl) {
45204511
// Diagnose because we weren't able to interpret the expression as one

test/AutoDiff/SILGen/has_symbol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/Library.swiftmodule -parse-as-library %t/Library.swift -enable-library-evolution
44
// RUN: %target-swift-frontend -emit-silgen %t/Client.swift -I %t -module-name test | %FileCheck %t/Client.swift
55

6-
// REQUIRES: VENDOR=apple
6+
// UNSUPPORTED: OS=windows-msvc
77

88
//--- Library.swift
99

test/IRGen/has_symbol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/has_symbol_helper.swiftmodule -parse-as-library %S/Inputs/has_symbol_helper.swift -enable-library-evolution -disable-availability-checking
33
// RUN: %target-swift-frontend -emit-irgen %s -I %t -module-name test | %FileCheck %s
44

5-
// REQUIRES: VENDOR=apple
5+
// UNSUPPORTED: OS=windows-msvc
66

77
// rdar://102246128
88
// REQUIRES: PTRSIZE=64

test/IRGen/has_symbol_async.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %target-swift-frontend -emit-irgen %s -I %t -module-name test | %FileCheck %s
44

55
// REQUIRES: concurrency
6-
// REQUIRES: VENDOR=apple
6+
// UNSUPPORTED: OS=windows-msvc
77

88
@_weakLinked import has_symbol_helper
99

test/Interpreter/has_symbol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// RUN: %target-run %t/test %t/%target-library-name(helper) | %FileCheck %s --check-prefix=NO-ANSWER
2727

2828
// REQUIRES: executable_test
29-
// REQUIRES: VENDOR=apple
29+
// UNSUPPORTED: OS=windows-msvc
3030

3131
// This test requires executable tests to be run on the same machine as the
3232
// compiler, as it links with a dylib that it doesn't arrange to get uploaded

test/Parse/has_symbol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/Library.swiftmodule -parse-as-library %t/Library.swift -enable-library-evolution
44
// RUN: %target-swift-frontend -typecheck -verify %t/Client.swift -I %t
55

6-
// REQUIRES: VENDOR=apple
6+
// UNSUPPORTED: OS=windows-msvc
77

88
//--- Library.swift
99

test/SIL/Parser/has_symbol.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/has_symbol_helper.swiftmodule -parse-as-library -enable-library-evolution %t/has_symbol_helper.swift
44
// RUN: %target-swift-frontend -emit-sil -verify %s -I %t/
55

6-
// REQUIRES: vendor=apple
6+
// UNSUPPORTED: OS=windows-msvc
77

88
sil_stage raw
99

test/SILGen/has_symbol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/has_symbol_helper.swiftmodule -parse-as-library %S/Inputs/has_symbol_helper.swift -enable-library-evolution
33
// RUN: %target-swift-frontend -emit-silgen %s -I %t -module-name test | %FileCheck %s
44

5-
// REQUIRES: VENDOR=apple
5+
// UNSUPPORTED: OS=windows-msvc
66

77
@_weakLinked import has_symbol_helper
88

test/SILOptimizer/has_symbol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %target-swift-frontend -O -emit-module -emit-module-path %t/Library.swiftmodule -parse-as-library %t/Library.swift -enable-library-evolution
44
// RUN: %target-swift-frontend -O -emit-sil %t/Client.swift -I %t -module-name test | %FileCheck %s
55

6-
// REQUIRES: VENDOR=apple
6+
// UNSUPPORTED: OS=windows-msvc
77

88
//--- Library.swift
99

test/Sema/has_symbol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %target-typecheck-verify-swift -disable-availability-checking -I %t
44
// RUN: %target-typecheck-verify-swift -disable-availability-checking -I %t -enable-experimental-feature ResultBuilderASTTransform
55

6-
// REQUIRES: VENDOR=apple
6+
// UNSUPPORTED: OS=windows-msvc
77

88
@_weakLinked import has_symbol_helper
99

test/Sema/has_symbol_unsupported.swift

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)