We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
md5: 0ac4980d3e4dd58534dd5827bcd1c36e
Issue Description:
This string does not get concatenated:
$ cat testStr.swift let sample = "a" + "გ" + "x"
$ /Library/Developer/Toolchains/swift-LOCAL-2017-03-22-a-base.xctoolchain/usr/bin/swiftc -Onone -emit-sil testStr.swift
bb0(%0 : $Int32, %1 : $UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>): alloc_global @_T07testStr6sampleSSv, loc "testStr.swift":1:5, scope 1 // id: %2 %3 = global_addr @_T07testStr6sampleSSv : $*String, loc "testStr.swift":1:5, scope 1 // user: %28 // function_ref static String.+ infix(String, String) -> String %4 = function_ref @_T0SS1poiS2S_SStFZ : $@convention(method) (@owned String, @owned String, @thin String.Type) -> @owned String, loc "testStr.swift":1:26, scope 1 // user: %27 %5 = metatype $@thin String.Type, loc "testStr.swift":1:26, scope 1 // user: %27 // function_ref static String.+ infix(String, String) -> String %6 = function_ref @_T0SS1poiS2S_SStFZ : $@convention(method) (@owned String, @owned String, @thin String.Type) -> @owned String, loc "testStr.swift":1:18, scope 1 // user: %20 %7 = metatype $@thin String.Type, loc "testStr.swift":1:18, scope 1 // user: %20 %8 = string_literal utf8 "a", loc "testStr.swift":1:14, scope 1 // user: %13 %9 = integer_literal $Builtin.Word, 1, loc "testStr.swift":1:14, scope 1 // user: %13 %10 = integer_literal $Builtin.Int1, -1, loc "testStr.swift":1:14, scope 1 // user: %13 %11 = metatype $@thin String.Type, loc "testStr.swift":1:14, scope 1 // user: %13 // function_ref String.init(_builtinStringLiteral : Builtin.RawPointer, utf8CodeUnitCount : Builtin.Word, isASCII : Builtin.Int1) -> String %12 = function_ref @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String, loc "testStr.swift":1:14, scope 1 // user: %13 %13 = apply %12(%8, %9, %10, %11) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String, loc "testStr.swift":1:14, scope 1 // user: %20 %14 = string_literal utf16 "გ", loc "testStr.swift":1:20, scope 1 // user: %19 %15 = integer_literal $Builtin.Word, 1, loc "testStr.swift":1:20, scope 1 // user: %19 %16 = integer_literal $Builtin.Int1, 0, loc "testStr.swift":1:20, scope 1 %17 = metatype $@thin String.Type, loc "testStr.swift":1:20, scope 1 // user: %19 // function_ref String.init(_builtinUTF16StringLiteral : Builtin.RawPointer, utf16CodeUnitCount : Builtin.Word) -> String %18 = function_ref @_T0S2SBp26_builtinUTF16StringLiteral_Bw18utf16CodeUnitCounttcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, @thin String.Type) -> @owned String, loc "testStr.swift":1:20, scope 1 // user: %19 %19 = apply %18(%14, %15, %17) : $@convention(method) (Builtin.RawPointer, Builtin.Word, @thin String.Type) -> @owned String, loc "testStr.swift":1:20, scope 1 // user: %20 %20 = apply %6(%13, %19, %7) : $@convention(method) (@owned String, @owned String, @thin String.Type) -> @owned String, loc "testStr.swift":1:18, scope 1 // user: %27 %21 = string_literal utf8 "x", loc "testStr.swift":1:28, scope 1 // user: %26 %22 = integer_literal $Builtin.Word, 1, loc "testStr.swift":1:28, scope 1 // user: %26 %23 = integer_literal $Builtin.Int1, -1, loc "testStr.swift":1:28, scope 1 // user: %26 %24 = metatype $@thin String.Type, loc "testStr.swift":1:28, scope 1 // user: %26 // function_ref String.init(_builtinStringLiteral : Builtin.RawPointer, utf8CodeUnitCount : Builtin.Word, isASCII : Builtin.Int1) -> String %25 = function_ref @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String, loc "testStr.swift":1:28, scope 1 // user: %26 %26 = apply %25(%21, %22, %23, %24) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String, loc "testStr.swift":1:28, scope 1 // user: %27 %27 = apply %4(%20, %26, %5) : $@convention(method) (@owned String, @owned String, @thin String.Type) -> @owned String, loc "testStr.swift":1:26, scope 1 // user: %28 store %27 to %3 : $*String, loc "testStr.swift":1:26, scope 1 // id: %28 %29 = integer_literal $Builtin.Int32, 0, scope 1 // user: %30 %30 = struct $Int32 (%29 : $Builtin.Int32), scope 1 // user: %31 return %30 : $Int32, scope 1 // id: %31 } // end sil function 'main'
The text was updated successfully, but these errors were encountered:
Roman did you work on this once? Can you take a look?
Sorry, something went wrong.
I know the reason. The fix is in progress.
Committed on swift/master as cfc216c
swiftix
No branches or pull requests
Additional Detail from JIRA
md5: 0ac4980d3e4dd58534dd5827bcd1c36e
Issue Description:
This string does not get concatenated:
$ cat testStr.swift
let sample = "a" + "გ" + "x"
$ /Library/Developer/Toolchains/swift-LOCAL-2017-03-22-a-base.xctoolchain/usr/bin/swiftc -Onone -emit-sil testStr.swift
bb0(%0 : $Int32, %1 : $UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>):
alloc_global @_T07testStr6sampleSSv, loc "testStr.swift":1:5, scope 1 // id: %2
%3 = global_addr @_T07testStr6sampleSSv : $*String, loc "testStr.swift":1:5, scope 1 // user: %28
// function_ref static String.+ infix(String, String) -> String
%4 = function_ref @_T0SS1poiS2S_SStFZ : $@convention(method) (@owned String, @owned String, @thin String.Type) -> @owned String, loc "testStr.swift":1:26, scope 1 // user: %27
%5 = metatype $@thin String.Type, loc "testStr.swift":1:26, scope 1 // user: %27
// function_ref static String.+ infix(String, String) -> String
%6 = function_ref @_T0SS1poiS2S_SStFZ : $@convention(method) (@owned String, @owned String, @thin String.Type) -> @owned String, loc "testStr.swift":1:18, scope 1 // user: %20
%7 = metatype $@thin String.Type, loc "testStr.swift":1:18, scope 1 // user: %20
%8 = string_literal utf8 "a", loc "testStr.swift":1:14, scope 1 // user: %13
%9 = integer_literal $Builtin.Word, 1, loc "testStr.swift":1:14, scope 1 // user: %13
%10 = integer_literal $Builtin.Int1, -1, loc "testStr.swift":1:14, scope 1 // user: %13
%11 = metatype $@thin String.Type, loc "testStr.swift":1:14, scope 1 // user: %13
// function_ref String.init(_builtinStringLiteral : Builtin.RawPointer, utf8CodeUnitCount : Builtin.Word, isASCII : Builtin.Int1) -> String
%12 = function_ref @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String, loc "testStr.swift":1:14, scope 1 // user: %13
%13 = apply %12(%8, %9, %10, %11) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String, loc "testStr.swift":1:14, scope 1 // user: %20
%14 = string_literal utf16 "გ", loc "testStr.swift":1:20, scope 1 // user: %19
%15 = integer_literal $Builtin.Word, 1, loc "testStr.swift":1:20, scope 1 // user: %19
%16 = integer_literal $Builtin.Int1, 0, loc "testStr.swift":1:20, scope 1
%17 = metatype $@thin String.Type, loc "testStr.swift":1:20, scope 1 // user: %19
// function_ref String.init(_builtinUTF16StringLiteral : Builtin.RawPointer, utf16CodeUnitCount : Builtin.Word) -> String
%18 = function_ref @_T0S2SBp26_builtinUTF16StringLiteral_Bw18utf16CodeUnitCounttcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, @thin String.Type) -> @owned String, loc "testStr.swift":1:20, scope 1 // user: %19
%19 = apply %18(%14, %15, %17) : $@convention(method) (Builtin.RawPointer, Builtin.Word, @thin String.Type) -> @owned String, loc "testStr.swift":1:20, scope 1 // user: %20
%20 = apply %6(%13, %19, %7) : $@convention(method) (@owned String, @owned String, @thin String.Type) -> @owned String, loc "testStr.swift":1:18, scope 1 // user: %27
%21 = string_literal utf8 "x", loc "testStr.swift":1:28, scope 1 // user: %26
%22 = integer_literal $Builtin.Word, 1, loc "testStr.swift":1:28, scope 1 // user: %26
%23 = integer_literal $Builtin.Int1, -1, loc "testStr.swift":1:28, scope 1 // user: %26
%24 = metatype $@thin String.Type, loc "testStr.swift":1:28, scope 1 // user: %26
// function_ref String.init(_builtinStringLiteral : Builtin.RawPointer, utf8CodeUnitCount : Builtin.Word, isASCII : Builtin.Int1) -> String
%25 = function_ref @_T0S2SBp21_builtinStringLiteral_Bw17utf8CodeUnitCountBi1_7isASCIItcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String, loc "testStr.swift":1:28, scope 1 // user: %26
%26 = apply %25(%21, %22, %23, %24) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String, loc "testStr.swift":1:28, scope 1 // user: %27
%27 = apply %4(%20, %26, %5) : $@convention(method) (@owned String, @owned String, @thin String.Type) -> @owned String, loc "testStr.swift":1:26, scope 1 // user: %28
store %27 to %3 : $*String, loc "testStr.swift":1:26, scope 1 // id: %28
%29 = integer_literal $Builtin.Int32, 0, scope 1 // user: %30
%30 = struct $Int32 (%29 : $Builtin.Int32), scope 1 // user: %31
return %30 : $Int32, scope 1 // id: %31
} // end sil function 'main'
The text was updated successfully, but these errors were encountered: