Skip to content

change mangling prefix from $S to $s #19388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion include/swift/Demangling/ManglingMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define MANGLE_AS_STRING(M) STRINGIFY_MANGLING(M)

/// The mangling prefix for the new mangling.
#define MANGLING_PREFIX $S
#define MANGLING_PREFIX $s

#define MANGLING_PREFIX_STR MANGLE_AS_STRING(MANGLING_PREFIX)

Expand Down
8 changes: 4 additions & 4 deletions test/APINotes/versioned-test-mangling.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// RUN: %empty-directory(%t)

// RUN: %target-swift-ide-test -F %S/Inputs/custom-frameworks -print-ast-typechecked -source-filename %s -swift-version 4 -find-mangled '$SSo11SomeCStructV' | %FileCheck -check-prefix=CHECK-TOP-ALIAS-4 %s
// RUN: %target-swift-ide-test -F %S/Inputs/custom-frameworks -print-ast-typechecked -source-filename %s -swift-version 5 -find-mangled '$SSo11SomeCStructV' | %FileCheck -check-prefix=CHECK-TOP-ALIAS-5 %s
// RUN: %target-swift-ide-test -F %S/Inputs/custom-frameworks -print-ast-typechecked -source-filename %s -swift-version 4 -find-mangled '$sSo11SomeCStructV' | %FileCheck -check-prefix=CHECK-TOP-ALIAS-4 %s
// RUN: %target-swift-ide-test -F %S/Inputs/custom-frameworks -print-ast-typechecked -source-filename %s -swift-version 5 -find-mangled '$sSo11SomeCStructV' | %FileCheck -check-prefix=CHECK-TOP-ALIAS-5 %s

// RUN: %target-swift-ide-test -F %S/Inputs/custom-frameworks -print-ast-typechecked -source-filename %s -swift-version 4 -find-mangled '$SSo13InnerInSwift5V' | %FileCheck -check-prefix=CHECK-NESTED-ALIAS-4 %s
// RUN: %target-swift-ide-test -F %S/Inputs/custom-frameworks -print-ast-typechecked -source-filename %s -swift-version 5 -find-mangled '$SSo13InnerInSwift5V' | %FileCheck -check-prefix=CHECK-NESTED-ALIAS-5 %s
// RUN: %target-swift-ide-test -F %S/Inputs/custom-frameworks -print-ast-typechecked -source-filename %s -swift-version 4 -find-mangled '$sSo13InnerInSwift5V' | %FileCheck -check-prefix=CHECK-NESTED-ALIAS-4 %s
// RUN: %target-swift-ide-test -F %S/Inputs/custom-frameworks -print-ast-typechecked -source-filename %s -swift-version 5 -find-mangled '$sSo13InnerInSwift5V' | %FileCheck -check-prefix=CHECK-NESTED-ALIAS-5 %s

import APINotesFrameworkTest

Expand Down
6 changes: 3 additions & 3 deletions test/APINotes/versioned.swift
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,14 @@ func testRenamedOptionyEnum() {
#if !swift(>=5)

func useSwift4Name(_: ImportantCStruct) {}
// CHECK-SILGEN-4: sil hidden @$S9versioned13useSwift4NameyySo11SomeCStructVF
// CHECK-SILGEN-4: sil hidden @$s9versioned13useSwift4NameyySo11SomeCStructVF

func useNewlyNested(_: InnerInSwift5) {}
// CHECK-SILGEN-4: sil hidden @$S9versioned14useNewlyNestedyySo13InnerInSwift5VF
// CHECK-SILGEN-4: sil hidden @$s9versioned14useNewlyNestedyySo13InnerInSwift5VF
#endif

func useSwift5Name(_: VeryImportantCStruct) {}
// CHECK-SILGEN: sil hidden @$S9versioned13useSwift5NameyySo11SomeCStructVF
// CHECK-SILGEN: sil hidden @$s9versioned13useSwift5NameyySo11SomeCStructVF



Expand Down
2 changes: 1 addition & 1 deletion test/ClangImporter/MixedSource/forward-declarations.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %target-swift-frontend -emit-ir -primary-file %s %S/Inputs/forward-declarations-other.swift -import-objc-header %S/Inputs/forward-declarations.h -enable-objc-interop -disable-objc-attr-requires-foundation-module -module-name main | %FileCheck %s

class Sub: Base {
// CHECK-LABEL: define{{.*}} void @"$S4main3SubC4testyyF"
// CHECK-LABEL: define{{.*}} void @"$s4main3SubC4testyyF"
func test() {
// CHECK: [[BASE_SELF:%.+]] = bitcast %T4main3SubC* %0 to %TSo4BaseC*
// CHECK: [[SELECTOR:%.+]] = load i8*, i8** @"\01L_selector(getClassInstanceWithoutMentioningItsName)"
Expand Down
10 changes: 5 additions & 5 deletions test/ClangImporter/attr-swift_private.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ public func testTopLevel() {
#endif
}

// CHECK-LABEL: define linkonce_odr hidden swiftcc %swift.metadata_response @"$SSo10PrivFooSubCMa{{.*}} {
// CHECK-LABEL: define linkonce_odr hidden swiftcc %swift.metadata_response @"$sSo10PrivFooSubCMa{{.*}} {
// CHECK: %objc_class** @"\01l_OBJC_CLASS_REF_$_PrivFooSub"
// CHECK: }

// CHECK-LABEL: define linkonce_odr hidden {{.+}} @"$SSo3BarC8__noArgsABSgyt_tcfcTO"
// CHECK-LABEL: define linkonce_odr hidden {{.+}} @"$sSo3BarC8__noArgsABSgyt_tcfcTO"
// CHECK: @"\01L_selector(initWithNoArgs)"
// CHECK-LABEL: define linkonce_odr hidden {{.+}} @"$SSo3BarC8__oneArgABSgs5Int32V_tcfcTO"
// CHECK-LABEL: define linkonce_odr hidden {{.+}} @"$sSo3BarC8__oneArgABSgs5Int32V_tcfcTO"
// CHECK: @"\01L_selector(initWithOneArg:)"
// CHECK-LABEL: define linkonce_odr hidden {{.+}} @"$SSo3BarC9__twoArgs5otherABSgs5Int32V_AGtcfcTO"
// CHECK-LABEL: define linkonce_odr hidden {{.+}} @"$sSo3BarC9__twoArgs5otherABSgs5Int32V_AGtcfcTO"
// CHECK: @"\01L_selector(initWithTwoArgs:other:)"
// CHECK-LABEL: define linkonce_odr hidden {{.+}} @"$SSo3BarC2__ABSgs5Int32V_tcfcTO"
// CHECK-LABEL: define linkonce_odr hidden {{.+}} @"$sSo3BarC2__ABSgs5Int32V_tcfcTO"
// CHECK: @"\01L_selector(init:)"

_ = __PrivAnonymousA
Expand Down
8 changes: 4 additions & 4 deletions test/ClangImporter/ctypes_ir.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

import ctypes

// CHECK-LABEL: define hidden swiftcc void @"$S9ctypes_ir9testColoryyF"
// CHECK-LABEL: define hidden swiftcc void @"$s9ctypes_ir9testColoryyF"
func testColor() {
// CHECK: store i32 1
var c : Color = green
}

// CHECK-LABEL: define hidden swiftcc void @"$S9ctypes_ir12testAnonEnumyyF"
// CHECK-LABEL: define hidden swiftcc void @"$s9ctypes_ir12testAnonEnumyyF"
func testAnonEnum() {
// CHECK: store i64 30064771073
var a = AnonConst2
}

// CHECK-LABEL: define hidden swiftcc void @"$S9ctypes_ir17testAnonEnumSmallyyF"
// CHECK-LABEL: define hidden swiftcc void @"$s9ctypes_ir17testAnonEnumSmallyyF"
func testAnonEnumSmall() {
// CHECK: store i64 17
var a = AnonConstSmall2
Expand All @@ -27,7 +27,7 @@ func testStructWithFlexibleArray(_ s : StructWithFlexibleArray) {
}

// Make sure flexible array struct member isn't represented in IR function signature as i0 (or at all). rdar://problem/18510461
// CHECK-LABEL: define hidden swiftcc void @"$S9ctypes_ir27testStructWithFlexibleArrayyySo0defG0aF"(i32)
// CHECK-LABEL: define hidden swiftcc void @"$s9ctypes_ir27testStructWithFlexibleArrayyySo0defG0aF"(i32)

typealias EightUp = (Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8)

Expand Down
2 changes: 1 addition & 1 deletion test/ClangImporter/enum-anon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func testDiags() {
#endif

// CHECK-LABEL: %TSo6SR2511V = type <{ %Ts5Int32V, %Ts6UInt32V, %Ts5Int32V }>
// CHECK-LABEL: define{{.*}} i32 @"$S4main6testIR1xs5Int32VSPySo6SR2511VG_tF"(
// CHECK-LABEL: define{{.*}} i32 @"$s4main6testIR1xs5Int32VSPySo6SR2511VG_tF"(
public func testIR(x: UnsafePointer<SR2511>) -> CInt {
// CHECK: store i32 1, i32* getelementptr inbounds (%Ts6UInt32V, %Ts6UInt32V* bitcast (i32* @global to %Ts6UInt32V*), i32 0, i32 0), align 4
global = VarConstant2
Expand Down
2 changes: 1 addition & 1 deletion test/ClangImporter/enum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -228,5 +228,5 @@ let _: UnknownOptionsThanksToAPINotes = .first // expected-error {{has no member
let _ = UnknownEnumThanksToAPINotesFirst
let _ = UnknownOptionsThanksToAPINotesFirst

// CHECK-IR: $S4enum12testMangling2e12e22e3ySo9EnumByTagV_So0gH7TypedefaSo0gH4BothVtF
// CHECK-IR: $s4enum12testMangling2e12e22e3ySo9EnumByTagV_So0gH7TypedefaSo0gH4BothVtF
func testMangling(e1: EnumByTag, e2: EnumByTypedef, e3: EnumByBoth) {}
2 changes: 1 addition & 1 deletion test/ClangImporter/nullability_silgen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import nullability
import Foundation

// null_resettable properties.
// CHECK-LABEL: sil hidden @$S18nullability_silgen18testNullResettable{{[_0-9a-zA-Z]*}}F
// CHECK-LABEL: sil hidden @$s18nullability_silgen18testNullResettable{{[_0-9a-zA-Z]*}}F
func testNullResettable(_ sc: SomeClass) {
sc.defaultedProperty = nil
sc.defaultedProperty = "hello"
Expand Down
Loading