Skip to content

Commit ab3bf32

Browse files
committed
[ModuleInterface] Print the @_spiOnly attribute without comments
This attribute was commented out in the private swiftinterface for backwards compatibility with older compilers unaware of the attribute. This scenario shouldn't be a problem anymore and without that attribute some imports can raise errors. Let's print the attribute as it was written in the sources without commenting it out.
1 parent 5f8338f commit ab3bf32

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/Frontend/ModuleInterfaceSupport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ static void printImports(raw_ostream &out,
329329
// compatible swiftinterfaces and we can live without
330330
// checking the generate code for a while.
331331
if (spiOnlyImportSet.count(import))
332-
out << "/*@_spiOnly*/ ";
332+
out << "@_spiOnly ";
333333

334334
// List of imported SPI groups for local use.
335335
for (auto spiName : spis)

test/SPI/spi_only_import_swiftinterfaces.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@
5252

5353
@_spiOnly @_spi(SomeSPIGroup) import A_SPIOnlyImported
5454
// CHECK-PUBLIC-NOT: A_SPIOnlyImported
55-
// CHECK-PRIVATE: {{^}}/*@_spiOnly*/ @_spi(SomeSPIGroup) import A_SPIOnlyImported
55+
// CHECK-PRIVATE: {{^}}@_spiOnly @_spi(SomeSPIGroup) import A_SPIOnlyImported
5656

5757
/// This is also imported as SPI only via FileB.swift
5858
@_spiOnly import ConstantSPIOnly
5959
// CHECK-PUBLIC-NOT: ConstantSPIOnly
60-
// CHECK-PRIVATE: {{^}}/*@_spiOnly*/ import ConstantSPIOnly
60+
// CHECK-PRIVATE: {{^}}@_spiOnly import ConstantSPIOnly
6161

6262
/// This is also imported as SPI only via FileB.swift
6363
@_implementationOnly import InconsistentIOI
6464
// CHECK-PUBLIC-NOT: InconsistentIOI
65-
// CHECK-PRIVATE: {{^}}/*@_spiOnly*/ import InconsistentIOI
65+
// CHECK-PRIVATE: {{^}}@_spiOnly import InconsistentIOI
6666

6767
/// This is also imported as SPI only via FileB.swift
6868
import InconsistentPublic

0 commit comments

Comments
 (0)