mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The availability macros definitions are parsed from the command line and stored in a cache. The cache was in the Parser, which would have it be computed for each file using availability macros. Let's move it to the ASTContext instead where it can generally be computed once per invocation and used across the module. rdar://134797088
24 lines
671 B
Swift
24 lines
671 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: split-file %s %t --leading-lines
|
|
|
|
// RUN: not %target-swift-frontend -typecheck -diagnostic-style llvm \
|
|
// RUN: %t/FileA.swift %t/FileB.swift \
|
|
// RUN: -define-availability "_justAName" \
|
|
// RUN: 2>&1 | %FileCheck %s
|
|
|
|
// CHECK: -define-availability argument:1:11: error: expected ':' after '_justAName' in availability macro definition
|
|
// CHECK-NEXT: _justAName
|
|
|
|
/// It's parsed once so the diagnostic is produced once as well.
|
|
// CHECK-NOT: _justAName
|
|
|
|
//--- FileA.swift
|
|
|
|
@available(_triggerParsingMacros)
|
|
public func brokenPlatforms() {}
|
|
|
|
//--- FileB.swift
|
|
|
|
@available(_triggerParsingMacros)
|
|
public func brokenPlatforms() {}
|