mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Don't print @_originallyDefinedIn with same mangling module name
It doesn't change anything about how we interpret the interface.
This commit is contained in:
@@ -1078,6 +1078,13 @@ bool DeclAttribute::printImpl(ASTPrinter &Printer, const PrintOptions &Options,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DeclAttrKind::OriginallyDefinedIn: {
|
||||
auto Attr = cast<OriginallyDefinedInAttr>(this);
|
||||
auto Name = D->getDeclContext()->getParentModule()->getName().str();
|
||||
if (Options.IsForSwiftInterface && Attr->ManglingModuleName == Name)
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
// RUN: %target-swift-frontend -emit-ir -parse-as-library -parse-stdlib %s -module-name Compatibility59 -module-abi-name Swift | %FileCheck %s --check-prefix=CHECK-SHIM
|
||||
// RUN: %target-swift-frontend -emit-ir -parse-as-library -parse-stdlib %s -module-name Compatibility59 -module-abi-name Swift | %FileCheck %s --check-prefix=ALSO-SHIM
|
||||
|
||||
// RUN: %target-swift-emit-module-interface(%t/Swift.swiftinterface) %s -parse-as-library -parse-stdlib -module-name Swift
|
||||
// RUN: %FileCheck %s --check-prefix=CHECK-INTERFACE < %t/Swift.swiftinterface
|
||||
|
||||
// REQUIRES: OS=macosx
|
||||
|
||||
// Let's just pretend...
|
||||
@@ -22,3 +25,8 @@ public struct Fridge<Contents> {}
|
||||
// The compatibility shim does not have any linker directives.
|
||||
// ALSO-SHIM-NOT: $ld$hide$
|
||||
// ALSO-SHIM-NOT: $ld$previous$
|
||||
|
||||
// There is no @_originallyDefinedIn in the swiftinterface:
|
||||
// CHECK-INTERFACE-NOT: @_originallyDefinedIn
|
||||
// CHECK-INTERFACE: @available(macOS 13, *)
|
||||
// CHECK-INTERFACE-NEXT: public struct Fridge<Contents> {
|
||||
|
||||
Reference in New Issue
Block a user