Skip to content

Instantly share code, notes, and snippets.

@53ningen
Last active April 10, 2016 09:53
Show Gist options
  • Save 53ningen/1aca5aa915799997a10e6762852ab40a to your computer and use it in GitHub Desktop.
Save 53ningen/1aca5aa915799997a10e6762852ab40a to your computer and use it in GitHub Desktop.
; ModuleID = 'Hoge'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.9"
%Vs5Int32 = type <{ i32 }>
%Sp = type <{ i8* }>
%swift.type = type { i64 }
%swift.type_pattern = type opaque
%swift.protocol_conformance = type { i32, i32, i32, i32 }
%swift.protocol = type { i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i32, i32 }
%Si = type <{ i64 }>
%O4Hoge4Hoge = type <{ i1 }>
%Sq = type <{ [1 x i8] }>
%Sq.16 = type <{}>
%swift.opaque = type opaque
@_TZvOs7Process5_argcVs5Int32 = external global %Vs5Int32, align 4
@globalinit_33_1BDF70FFC18749BAB495A73B459ED2F0_token5 = external global i64, align 8
@_TZvOs7Process11_unsafeArgvGSpGSpVs4Int8__ = external global %Sp, align 8
@_TWPO4Hoge4Hoges9EquatableS_ = constant [1 x i8*] [i8* bitcast (i1 (%O4Hoge4Hoge*, %O4Hoge4Hoge*, %swift.type*, %swift.type*)* @_TTWO4Hoge4Hoges9EquatableS_ZFS1_oi2eefTxx_Sb to i8*)], align 8
@_TWPO4Hoge4Hoges8HashableS_ = constant [2 x i8*] [i8* bitcast ([1 x i8*]* @_TWPO4Hoge4Hoges9EquatableS_ to i8*), i8* bitcast (i64 (%O4Hoge4Hoge*, %swift.type*)* @_TTWO4Hoge4Hoges8HashableS_FS1_g9hashValueSi to i8*)], align 8
@_TWVO4Hoge4Hoge = constant [26 x i8*] [i8* bitcast (void (i8*, %swift.type*)* @__swift_noop_void_return to i8*), i8* bitcast (i8* (i8*, i8*, %swift.type*)* @__swift_memcpy1_1 to i8*), i8* bitcast (i8* (i8*, %swift.type*)* @__swift_noop_self_return to i8*), i8* bitcast (void (i8*, %swift.type*)* @__swift_noop_void_return to i8*), i8* bitcast (void (i8*, %swift.type*)* @__swift_noop_void_return to i8*), i8* bitcast (i8* (i8*, i8*, %swift.type*)* @__swift_memcpy1_1 to i8*), i8* bitcast (i8* (i8*, i8*, %swift.type*)* @__swift_memcpy1_1 to i8*), i8* bitcast (i8* (i8*, i8*, %swift.type*)* @__swift_memcpy1_1 to i8*), i8* bitcast (i8* (i8*, i8*, %swift.type*)* @__swift_memcpy1_1 to i8*), i8* bitcast (i8* (i8*, i8*, %swift.type*)* @__swift_memcpy1_1 to i8*), i8* bitcast (i8* (i8*, i8*, %swift.type*)* @__swift_memcpy1_1 to i8*), i8* bitcast (i8* (i8*, %swift.type*)* @__swift_noop_self_return to i8*), i8* bitcast (i8* (i8*, i8*, %swift.type*)* @__swift_memcpy1_1 to i8*), i8* bitcast (void (i8*, %swift.type*)* @__swift_noop_void_return to i8*), i8* bitcast (i8* (i8*, i8*, i64, %swift.type*)* @__swift_memcpy_array1_1 to i8*), i8* bitcast (i8* (i8*, i8*, i64, %swift.type*)* @__swift_memmove_array1_1 to i8*), i8* bitcast (i8* (i8*, i8*, i64, %swift.type*)* @__swift_memmove_array1_1 to i8*), i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 2359296 to i8*), i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 254 to i8*), i8* bitcast (void (%swift.opaque*, i32, %swift.type*)* @_TwxsO4Hoge4Hoge to i8*), i8* bitcast (i32 (%swift.opaque*, %swift.type*)* @_TwxgO4Hoge4Hoge to i8*), i8* bitcast (i32 (%swift.opaque*, %swift.type*)* @_TwugO4Hoge4Hoge to i8*), i8* bitcast (void (%swift.opaque*, %swift.type*)* @_TwupO4Hoge4Hoge to i8*), i8* bitcast (void (%swift.opaque*, i32, %swift.type*)* @_TwuiO4Hoge4Hoge to i8*)], align 8
@0 = private unnamed_addr constant [12 x i8] c"O4Hoge4Hoge\00"
@1 = private unnamed_addr constant [12 x i8] c"Next\00Error\00\00"
@_TMnO4Hoge4Hoge = constant { i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 } { i64 2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @0, i64 0, i64 0), i32 0, i32 2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @1, i64 0, i64 0), %swift.type** (%swift.type*)* @get_field_types_Hoge, %swift.type_pattern* null, i32 0, i32 0, i32 0 }, align 8
@_TMfO4Hoge4Hoge = internal constant { i8**, i64, { i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 }*, %swift.type* } { i8** getelementptr inbounds ([26 x i8*], [26 x i8*]* @_TWVO4Hoge4Hoge, i32 0, i32 0), i64 2, { i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 }* @_TMnO4Hoge4Hoge, %swift.type* null }, align 8
@"\01l_protocol_conformances" = private constant [2 x %swift.protocol_conformance] [%swift.protocol_conformance { i32 add (i32 trunc (i64 sub (i64 ptrtoint (%swift.protocol** @got._TMps9Equatable to i64), i64 ptrtoint ([2 x %swift.protocol_conformance]* @"\01l_protocol_conformances" to i64)) to i32), i32 1), i32 trunc (i64 sub (i64 ptrtoint (i64* getelementptr inbounds ({ i8**, i64, { i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 }*, %swift.type* }, { i8**, i64, { i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 }*, %swift.type* }* @_TMfO4Hoge4Hoge, i32 0, i32 1) to i64), i64 ptrtoint (i32* getelementptr inbounds ([2 x %swift.protocol_conformance], [2 x %swift.protocol_conformance]* @"\01l_protocol_conformances", i32 0, i32 0, i32 1) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8*]* @_TWPO4Hoge4Hoges9EquatableS_ to i64), i64 ptrtoint (i32* getelementptr inbounds ([2 x %swift.protocol_conformance], [2 x %swift.protocol_conformance]* @"\01l_protocol_conformances", i32 0, i32 0, i32 2) to i64)) to i32), i32 1 }, %swift.protocol_conformance { i32 add (i32 trunc (i64 sub (i64 ptrtoint (%swift.protocol** @got._TMps8Hashable to i64), i64 ptrtoint (i32* getelementptr inbounds ([2 x %swift.protocol_conformance], [2 x %swift.protocol_conformance]* @"\01l_protocol_conformances", i32 0, i32 1, i32 0) to i64)) to i32), i32 1), i32 trunc (i64 sub (i64 ptrtoint (i64* getelementptr inbounds ({ i8**, i64, { i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 }*, %swift.type* }, { i8**, i64, { i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 }*, %swift.type* }* @_TMfO4Hoge4Hoge, i32 0, i32 1) to i64), i64 ptrtoint (i32* getelementptr inbounds ([2 x %swift.protocol_conformance], [2 x %swift.protocol_conformance]* @"\01l_protocol_conformances", i32 0, i32 1, i32 1) to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8*]* @_TWPO4Hoge4Hoges8HashableS_ to i64), i64 ptrtoint (i32* getelementptr inbounds ([2 x %swift.protocol_conformance], [2 x %swift.protocol_conformance]* @"\01l_protocol_conformances", i32 0, i32 1, i32 2) to i64)) to i32), i32 1 }], section "__TEXT, __swift2_proto, regular, no_dead_strip", align 8
@_TMps9Equatable = external global %swift.protocol, align 8
@got._TMps9Equatable = private unnamed_addr constant %swift.protocol* @_TMps9Equatable
@_TMps8Hashable = external global %swift.protocol, align 8
@got._TMps8Hashable = private unnamed_addr constant %swift.protocol* @_TMps8Hashable
@field_type_vector_Hoge = private global %swift.type** null
@llvm.used = appending global [13 x i8*] [i8* bitcast (i1 (%O4Hoge4Hoge*, %O4Hoge4Hoge*, %swift.type*, %swift.type*)* @_TTWO4Hoge4Hoges9EquatableS_ZFS1_oi2eefTxx_Sb to i8*), i8* bitcast (i64 (%O4Hoge4Hoge*, %swift.type*)* @_TTWO4Hoge4Hoges8HashableS_FS1_g9hashValueSi to i8*), i8* bitcast ([1 x i8*]* @_TWPO4Hoge4Hoges9EquatableS_ to i8*), i8* bitcast ([1 x i8*]* @_TWPO4Hoge4Hoges9EquatableS_ to i8*), i8* bitcast (i8** ()* @_TWaO4Hoge4Hoges9EquatableS_ to i8*), i8* bitcast ([2 x i8*]* @_TWPO4Hoge4Hoges8HashableS_ to i8*), i8* bitcast (i8** ()* @_TWaO4Hoge4Hoges8HashableS_ to i8*), i8* bitcast ([26 x i8*]* @_TWVO4Hoge4Hoge to i8*), i8* bitcast ({ i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 }* @_TMnO4Hoge4Hoge to i8*), i8* bitcast (%swift.type* ()* @_TMaO4Hoge4Hoge to i8*), i8* bitcast ({ i8**, i64, { i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 }*, %swift.type* }* @_TMfO4Hoge4Hoge to i8*), i8* bitcast (%swift.type* @_TMO4Hoge4Hoge to i8*), i8* bitcast ([2 x %swift.protocol_conformance]* @"\01l_protocol_conformances" to i8*)], section "llvm.metadata", align 8
@_TMO4Hoge4Hoge = alias %swift.type, bitcast (i64* getelementptr inbounds ({ i8**, i64, { i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 }*, %swift.type* }, { i8**, i64, { i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 }*, %swift.type* }* @_TMfO4Hoge4Hoge, i32 0, i32 1) to %swift.type*)
define i32 @main(i32, i8**) #0 {
entry:
%2 = bitcast i8** %1 to i8*
store i32 %0, i32* getelementptr inbounds (%Vs5Int32, %Vs5Int32* @_TZvOs7Process5_argcVs5Int32, i32 0, i32 0), align 4
%3 = load i64, i64* @globalinit_33_1BDF70FFC18749BAB495A73B459ED2F0_token5, align 8
%4 = icmp eq i64 %3, -1
br i1 %4, label %once_done, label %once_not_done
once_not_done: ; preds = %entry
call void @swift_once(i64* @globalinit_33_1BDF70FFC18749BAB495A73B459ED2F0_token5, i8* bitcast (void ()* @globalinit_33_1BDF70FFC18749BAB495A73B459ED2F0_func5 to i8*))
br label %once_done
once_done: ; preds = %once_not_done, %entry
%5 = load i64, i64* @globalinit_33_1BDF70FFC18749BAB495A73B459ED2F0_token5, align 8
%6 = icmp eq i64 %5, -1
call void @llvm.assume(i1 %6)
store i8* %2, i8** getelementptr inbounds (%Sp, %Sp* @_TZvOs7Process11_unsafeArgvGSpGSpVs4Int8__, i32 0, i32 0), align 8
ret i32 0
}
declare void @globalinit_33_1BDF70FFC18749BAB495A73B459ED2F0_func5() #0
declare void @swift_once(i64*, i8*)
; Function Attrs: nounwind
declare void @llvm.assume(i1) #1
define hidden i64 @_TFO4Hoge4Hogeg9hashValueSi(i1) #0 {
entry:
%1 = alloca %Si, align 8
%2 = bitcast %Si* %1 to i8*
call void @llvm.lifetime.start(i64 8, i8* %2)
switch i1 %0, label %3 [
i1 false, label %4
i1 true, label %5
]
; <label>:3 ; preds = %entry
unreachable
; <label>:4 ; preds = %entry
%._value2 = getelementptr inbounds %Si, %Si* %1, i32 0, i32 0
store i64 0, i64* %._value2, align 8
br label %6
; <label>:5 ; preds = %entry
%._value = getelementptr inbounds %Si, %Si* %1, i32 0, i32 0
store i64 1, i64* %._value, align 8
br label %6
; <label>:6 ; preds = %4, %5
%._value1 = getelementptr inbounds %Si, %Si* %1, i32 0, i32 0
%7 = load i64, i64* %._value1, align 8
%8 = call i64 @_TFSig9hashValueSi(i64 %7)
%9 = bitcast %Si* %1 to i8*
call void @llvm.lifetime.end(i64 8, i8* %9)
ret i64 %8
}
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.start(i64, i8* nocapture) #2
declare i64 @_TFSig9hashValueSi(i64) #0
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.end(i64, i8* nocapture) #2
define hidden i1 @_TZF4Hogeoi2eeFTOS_4HogeS0__Sb(i1, i1) #0 {
entry:
%2 = alloca %Si, align 8
%3 = alloca %Si, align 8
%4 = bitcast %Si* %2 to i8*
call void @llvm.lifetime.start(i64 8, i8* %4)
%5 = bitcast %Si* %3 to i8*
call void @llvm.lifetime.start(i64 8, i8* %5)
switch i1 %0, label %6 [
i1 false, label %7
i1 true, label %8
]
; <label>:6 ; preds = %entry
unreachable
; <label>:7 ; preds = %entry
%._value5 = getelementptr inbounds %Si, %Si* %2, i32 0, i32 0
store i64 0, i64* %._value5, align 8
br label %9
; <label>:8 ; preds = %entry
%._value = getelementptr inbounds %Si, %Si* %2, i32 0, i32 0
store i64 1, i64* %._value, align 8
br label %9
; <label>:9 ; preds = %7, %8
switch i1 %1, label %10 [
i1 false, label %11
i1 true, label %12
]
; <label>:10 ; preds = %9
unreachable
; <label>:11 ; preds = %9
%._value4 = getelementptr inbounds %Si, %Si* %3, i32 0, i32 0
store i64 0, i64* %._value4, align 8
br label %13
; <label>:12 ; preds = %9
%._value1 = getelementptr inbounds %Si, %Si* %3, i32 0, i32 0
store i64 1, i64* %._value1, align 8
br label %13
; <label>:13 ; preds = %11, %12
%._value2 = getelementptr inbounds %Si, %Si* %2, i32 0, i32 0
%14 = load i64, i64* %._value2, align 8
%._value3 = getelementptr inbounds %Si, %Si* %3, i32 0, i32 0
%15 = load i64, i64* %._value3, align 8
%16 = icmp eq i64 %14, %15
%17 = bitcast %Si* %3 to i8*
call void @llvm.lifetime.end(i64 8, i8* %17)
%18 = bitcast %Si* %2 to i8*
call void @llvm.lifetime.end(i64 8, i8* %18)
ret i1 %16
}
define i1 @_TTWO4Hoge4Hoges9EquatableS_ZFS1_oi2eefTxx_Sb(%O4Hoge4Hoge* noalias nocapture dereferenceable(1), %O4Hoge4Hoge* noalias nocapture dereferenceable(1), %swift.type*, %swift.type* %Self) #0 {
entry:
%3 = getelementptr inbounds %O4Hoge4Hoge, %O4Hoge4Hoge* %0, i32 0, i32 0
%4 = load i1, i1* %3, align 1
%5 = getelementptr inbounds %O4Hoge4Hoge, %O4Hoge4Hoge* %1, i32 0, i32 0
%6 = load i1, i1* %5, align 1
%7 = call i1 @_TZF4Hogeoi2eeFTOS_4HogeS0__Sb(i1 %4, i1 %6) #4
ret i1 %7
}
define i64 @_TTWO4Hoge4Hoges8HashableS_FS1_g9hashValueSi(%O4Hoge4Hoge* noalias nocapture dereferenceable(1), %swift.type* %Self) #0 {
entry:
%1 = getelementptr inbounds %O4Hoge4Hoge, %O4Hoge4Hoge* %0, i32 0, i32 0
%2 = load i1, i1* %1, align 1
%3 = call i64 @_TFO4Hoge4Hogeg9hashValueSi(i1 %2) #4
ret i64 %3
}
define hidden i1 @_TF4Hoge4hogeFGSqOS_4Hoge_Sb(i8) #0 {
entry:
%1 = alloca %Sq, align 1
%2 = alloca %Sq, align 1
%3 = alloca %Sq, align 1
%4 = bitcast %Sq* %1 to i8*
call void @llvm.lifetime.start(i64 1, i8* %4)
%5 = bitcast %Sq* %1 to i8*
store i8 %0, i8* %5, align 1
%6 = bitcast %Sq* %2 to i8*
call void @llvm.lifetime.start(i64 1, i8* %6)
%7 = bitcast %Sq* %2 to i8*
store i8 2, i8* %7, align 1
%8 = bitcast %Sq* %2 to i8*
%9 = load i8, i8* %8, align 1
%10 = bitcast %Sq* %3 to i8*
call void @llvm.lifetime.start(i64 1, i8* %10)
%11 = bitcast %Sq* %3 to i8*
store i8 %9, i8* %11, align 1
%12 = bitcast %Sq* %1 to %Sq.16*
%13 = bitcast %Sq* %3 to %Sq.16*
%14 = call i1 @_TZFsoi2neuRxs9EquatablerFTGSqx_GSqx__Sb(%Sq.16* noalias nocapture %12, %Sq.16* noalias nocapture %13, %swift.type* bitcast (i64* getelementptr inbounds ({ i8**, i64, { i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 }*, %swift.type* }, { i8**, i64, { i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 }*, %swift.type* }* @_TMfO4Hoge4Hoge, i32 0, i32 1) to %swift.type*), i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @_TWPO4Hoge4Hoges9EquatableS_, i32 0, i32 0))
%15 = bitcast %Sq* %3 to i8*
call void @llvm.lifetime.end(i64 1, i8* %15)
%16 = bitcast %Sq* %2 to i8*
call void @llvm.lifetime.end(i64 1, i8* %16)
%17 = bitcast %Sq* %1 to i8*
call void @llvm.lifetime.end(i64 1, i8* %17)
ret i1 %14
}
declare i1 @_TZFsoi2neuRxs9EquatablerFTGSqx_GSqx__Sb(%Sq.16* noalias nocapture, %Sq.16* noalias nocapture, %swift.type*, i8**) #0
define hidden i1 @_TF4Hoge3fooFSbSb(i1) #0 {
entry:
%1 = xor i1 %0, true
ret i1 %1
}
define i8** @_TWaO4Hoge4Hoges9EquatableS_() #0 {
entry:
ret i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @_TWPO4Hoge4Hoges9EquatableS_, i32 0, i32 0)
}
define i8** @_TWaO4Hoge4Hoges8HashableS_() #0 {
entry:
ret i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @_TWPO4Hoge4Hoges8HashableS_, i32 0, i32 0)
}
; Function Attrs: nounwind
define linkonce_odr hidden void @__swift_noop_void_return(i8*, %swift.type*) #1 {
entry:
ret void
}
; Function Attrs: nounwind
define linkonce_odr hidden i8* @__swift_memcpy1_1(i8*, i8*, %swift.type*) #1 {
entry:
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 1, i32 1, i1 false)
ret i8* %0
}
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #2
; Function Attrs: nounwind
define linkonce_odr hidden i8* @__swift_noop_self_return(i8*, %swift.type*) #1 {
entry:
ret i8* %0
}
; Function Attrs: nounwind
define linkonce_odr hidden i8* @__swift_memcpy_array1_1(i8*, i8*, i64, %swift.type*) #1 {
entry:
%4 = mul nuw i64 %2, 1
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %0, i8* %1, i64 %4, i32 1, i1 false)
ret i8* %0
}
; Function Attrs: nounwind
define linkonce_odr hidden i8* @__swift_memmove_array1_1(i8*, i8*, i64, %swift.type*) #1 {
entry:
%4 = mul nuw i64 %2, 1
call void @llvm.memmove.p0i8.p0i8.i64(i8* %0, i8* %1, i64 %4, i32 1, i1 false)
ret i8* %0
}
; Function Attrs: argmemonly nounwind
declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #2
define linkonce_odr hidden void @_TwxsO4Hoge4Hoge(%swift.opaque* %dest, i32 %index, %swift.type* %Self) #0 {
entry:
%0 = bitcast %swift.opaque* %dest to %O4Hoge4Hoge*
%1 = bitcast %O4Hoge4Hoge* %0 to i8*
%2 = trunc i32 %index to i8
%3 = add i8 %2, 2
store i8 %3, i8* %1, align 1
ret void
}
define linkonce_odr hidden i32 @_TwxgO4Hoge4Hoge(%swift.opaque* %src, %swift.type* %Self) #0 {
entry:
%0 = bitcast %swift.opaque* %src to %O4Hoge4Hoge*
%1 = bitcast %O4Hoge4Hoge* %0 to i8*
%2 = load i8, i8* %1, align 1
%3 = zext i8 %2 to i32
%4 = sub i32 %3, 2
%5 = icmp slt i32 %4, 0
%6 = select i1 %5, i32 -1, i32 %4
ret i32 %6
}
define linkonce_odr hidden i32 @_TwugO4Hoge4Hoge(%swift.opaque* %value, %swift.type* %Self) #0 {
entry:
%0 = bitcast %swift.opaque* %value to %O4Hoge4Hoge*
%1 = getelementptr inbounds %O4Hoge4Hoge, %O4Hoge4Hoge* %0, i32 0, i32 0
%2 = load i1, i1* %1, align 1
%3 = zext i1 %2 to i32
ret i32 %3
}
define linkonce_odr hidden void @_TwupO4Hoge4Hoge(%swift.opaque* %value, %swift.type* %Self) #0 {
entry:
ret void
}
define linkonce_odr hidden void @_TwuiO4Hoge4Hoge(%swift.opaque* %value, i32 %tag, %swift.type* %Self) #0 {
entry:
%0 = bitcast %swift.opaque* %value to %O4Hoge4Hoge*
%1 = trunc i32 %tag to i1
%2 = getelementptr inbounds %O4Hoge4Hoge, %O4Hoge4Hoge* %0, i32 0, i32 0
store i1 %1, i1* %2, align 1
ret void
}
define private %swift.type** @get_field_types_Hoge(%swift.type*) #0 {
entry:
%1 = load %swift.type**, %swift.type*** @field_type_vector_Hoge, align 8
%2 = icmp eq %swift.type** %1, null
br i1 %2, label %build_field_types, label %done
build_field_types: ; preds = %entry
%3 = call noalias i8* @swift_slowAlloc(i64 0, i64 7) #1
%4 = bitcast i8* %3 to %swift.type**
%5 = ptrtoint %swift.type** %4 to i64
%6 = cmpxchg i64* bitcast (%swift.type*** @field_type_vector_Hoge to i64*), i64 0, i64 %5 seq_cst seq_cst
%7 = extractvalue { i64, i1 } %6, 1
%8 = extractvalue { i64, i1 } %6, 0
br i1 %7, label %done, label %race_lost
race_lost: ; preds = %build_field_types
call void @swift_slowDealloc(i8* %3, i64 0, i64 7) #1
%9 = inttoptr i64 %8 to %swift.type**
br label %done
done: ; preds = %race_lost, %build_field_types, %entry
%10 = phi %swift.type** [ %1, %entry ], [ %4, %build_field_types ], [ %9, %race_lost ]
ret %swift.type** %10
}
; Function Attrs: nounwind readnone
define %swift.type* @_TMaO4Hoge4Hoge() #3 {
entry:
ret %swift.type* bitcast (i64* getelementptr inbounds ({ i8**, i64, { i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 }*, %swift.type* }, { i8**, i64, { i64, i8*, i32, i32, i8*, %swift.type** (%swift.type*)*, %swift.type_pattern*, i32, i32, i32 }*, %swift.type* }* @_TMfO4Hoge4Hoge, i32 0, i32 1) to %swift.type*)
}
declare i8* @swift_slowAlloc(i64, i64)
declare void @swift_slowDealloc(i8*, i64, i64)
attributes #0 = { "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "target-cpu"="core2" "target-features"="+ssse3,+cx16,+fxsr,+mmx,+sse,+sse2,+sse3" }
attributes #1 = { nounwind }
attributes #2 = { argmemonly nounwind }
attributes #3 = { nounwind readnone "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "target-cpu"="core2" "target-features"="+ssse3,+cx16,+fxsr,+mmx,+sse,+sse2,+sse3" }
attributes #4 = { noinline }
!llvm.module.flags = !{!0, !1, !2, !3, !4, !8, !9}
!0 = !{i32 1, !"Objective-C Version", i32 2}
!1 = !{i32 1, !"Objective-C Image Info Version", i32 0}
!2 = !{i32 1, !"Objective-C Image Info Section", !"__DATA, __objc_imageinfo, regular, no_dead_strip"}
!3 = !{i32 4, !"Objective-C Garbage Collection", i32 768}
!4 = !{i32 6, !"Linker Options", !5}
!5 = !{!6, !7}
!6 = !{!"-lswiftCore"}
!7 = !{!"-lobjc"}
!8 = !{i32 1, !"PIC Level", i32 2}
!9 = !{i32 1, !"Swift Version", i32 3}
enum Hoge {
case Next
case Error
}
func hoge(arg: Hoge?) -> Bool {
return arg != nil
}
func foo(arg: Bool) -> Bool {
return !arg
}
.section __TEXT,__text,regular,pure_instructions
.macosx_version_min 10, 9
.globl _main
.align 4, 0x90
_main:
.cfi_startproc
pushq %rbp
Ltmp0:
.cfi_def_cfa_offset 16
Ltmp1:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp2:
.cfi_def_cfa_register %rbp
subq $16, %rsp
movq _globalinit_33_1BDF70FFC18749BAB495A73B459ED2F0_token5@GOTPCREL(%rip), %rax
movq __TZvOs7Process5_argcVs5Int32@GOTPCREL(%rip), %rcx
movl %edi, (%rcx)
cmpq $-1, (%rax)
movq %rsi, -8(%rbp)
je LBB0_2
movq _globalinit_33_1BDF70FFC18749BAB495A73B459ED2F0_token5@GOTPCREL(%rip), %rdi
movq _globalinit_33_1BDF70FFC18749BAB495A73B459ED2F0_func5@GOTPCREL(%rip), %rax
movq %rax, %rsi
callq _swift_once
LBB0_2:
xorl %eax, %eax
movq __TZvOs7Process11_unsafeArgvGSpGSpVs4Int8__@GOTPCREL(%rip), %rcx
movq -8(%rbp), %rdx
movq %rdx, (%rcx)
addq $16, %rsp
popq %rbp
retq
.cfi_endproc
.private_extern __TFO6output4Hogeg9hashValueSi
.globl __TFO6output4Hogeg9hashValueSi
.align 4, 0x90
__TFO6output4Hogeg9hashValueSi:
.cfi_startproc
pushq %rbp
Ltmp3:
.cfi_def_cfa_offset 16
Ltmp4:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp5:
.cfi_def_cfa_register %rbp
subq $16, %rsp
movb %dil, %al
testb $1, %al
movb %al, -9(%rbp)
jne LBB1_3
jmp LBB1_5
LBB1_5:
movb -9(%rbp), %al
testb $1, %al
je LBB1_2
jmp LBB1_1
LBB1_1:
LBB1_2:
movq $0, -8(%rbp)
jmp LBB1_4
LBB1_3:
movq $1, -8(%rbp)
LBB1_4:
movq -8(%rbp), %rdi
callq __TFSig9hashValueSi
addq $16, %rsp
popq %rbp
retq
.cfi_endproc
.private_extern __TZF6outputoi2eeFTOS_4HogeS0__Sb
.globl __TZF6outputoi2eeFTOS_4HogeS0__Sb
.align 4, 0x90
__TZF6outputoi2eeFTOS_4HogeS0__Sb:
.cfi_startproc
pushq %rbp
Ltmp6:
.cfi_def_cfa_offset 16
Ltmp7:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp8:
.cfi_def_cfa_register %rbp
movb %sil, %al
movb %dil, %cl
testb $1, %cl
movb %al, -17(%rbp)
movb %cl, -18(%rbp)
jne LBB2_3
jmp LBB2_9
LBB2_9:
movb -18(%rbp), %al
testb $1, %al
je LBB2_2
jmp LBB2_1
LBB2_1:
LBB2_2:
movq $0, -8(%rbp)
jmp LBB2_4
LBB2_3:
movq $1, -8(%rbp)
LBB2_4:
movb -17(%rbp), %al
testb $1, %al
jne LBB2_7
jmp LBB2_10
LBB2_10:
movb -17(%rbp), %al
testb $1, %al
je LBB2_6
jmp LBB2_5
LBB2_5:
LBB2_6:
movq $0, -16(%rbp)
jmp LBB2_8
LBB2_7:
movq $1, -16(%rbp)
LBB2_8:
movq -8(%rbp), %rax
movq -16(%rbp), %rcx
subq %rcx, %rax
sete %dl
movq %rax, -32(%rbp)
movb %dl, %al
popq %rbp
retq
.cfi_endproc
.globl __TTWO6output4Hoges9EquatableS_ZFS1_oi2eefTxx_Sb
.align 4, 0x90
__TTWO6output4Hoges9EquatableS_ZFS1_oi2eefTxx_Sb:
.cfi_startproc
pushq %rbp
Ltmp9:
.cfi_def_cfa_offset 16
Ltmp10:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp11:
.cfi_def_cfa_register %rbp
subq $32, %rsp
movzbl (%rsi), %esi
movzbl (%rdi), %edi
movq %rdx, -8(%rbp)
movq %rcx, -16(%rbp)
callq __TZF6outputoi2eeFTOS_4HogeS0__Sb
movb %al, %r8b
movb %r8b, -17(%rbp)
addq $32, %rsp
popq %rbp
retq
.cfi_endproc
.globl __TTWO6output4Hoges8HashableS_FS1_g9hashValueSi
.align 4, 0x90
__TTWO6output4Hoges8HashableS_FS1_g9hashValueSi:
.cfi_startproc
pushq %rbp
Ltmp12:
.cfi_def_cfa_offset 16
Ltmp13:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp14:
.cfi_def_cfa_register %rbp
subq $16, %rsp
movb (%rdi), %al
movzbl %al, %edi
movq %rsi, -8(%rbp)
callq __TFO6output4Hogeg9hashValueSi
addq $16, %rsp
popq %rbp
retq
.cfi_endproc
.private_extern __TF6output4hogeFGSqOS_4Hoge_Sb
.globl __TF6output4hogeFGSqOS_4Hoge_Sb
.align 4, 0x90
__TF6output4hogeFGSqOS_4Hoge_Sb:
.cfi_startproc
pushq %rbp
Ltmp15:
.cfi_def_cfa_offset 16
Ltmp16:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp17:
.cfi_def_cfa_register %rbp
subq $32, %rsp
movb %dil, %al
movb %al, -8(%rbp)
movb $2, -16(%rbp)
movb $2, -24(%rbp)
leaq __TMfO6output4Hoge+8(%rip), %rdx
leaq __TWPO6output4Hoges9EquatableS_(%rip), %rcx
leaq -8(%rbp), %rdi
leaq -24(%rbp), %rsi
callq __TZFsoi2neuRxs9EquatablerFTGSqx_GSqx__Sb
movb %al, %r8b
movb %r8b, -25(%rbp)
addq $32, %rsp
popq %rbp
retq
.cfi_endproc
.private_extern __TF6output3fooFSbSb
.globl __TF6output3fooFSbSb
.align 4, 0x90
__TF6output3fooFSbSb:
.cfi_startproc
pushq %rbp
Ltmp18:
.cfi_def_cfa_offset 16
Ltmp19:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp20:
.cfi_def_cfa_register %rbp
movb %dil, %al
xorb $1, %al
popq %rbp
retq
.cfi_endproc
.globl __TWaO6output4Hoges9EquatableS_
.align 4, 0x90
__TWaO6output4Hoges9EquatableS_:
.cfi_startproc
pushq %rbp
Ltmp21:
.cfi_def_cfa_offset 16
Ltmp22:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp23:
.cfi_def_cfa_register %rbp
leaq __TWPO6output4Hoges9EquatableS_(%rip), %rax
popq %rbp
retq
.cfi_endproc
.globl __TWaO6output4Hoges8HashableS_
.align 4, 0x90
__TWaO6output4Hoges8HashableS_:
.cfi_startproc
pushq %rbp
Ltmp24:
.cfi_def_cfa_offset 16
Ltmp25:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp26:
.cfi_def_cfa_register %rbp
leaq __TWPO6output4Hoges8HashableS_(%rip), %rax
popq %rbp
retq
.cfi_endproc
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
.private_extern ___swift_noop_void_return
.globl ___swift_noop_void_return
.weak_definition ___swift_noop_void_return
.align 4, 0x90
___swift_noop_void_return:
movq %rdi, -8(%rsp)
movq %rsi, -16(%rsp)
retq
.private_extern ___swift_memcpy1_1
.globl ___swift_memcpy1_1
.weak_definition ___swift_memcpy1_1
.align 4, 0x90
___swift_memcpy1_1:
movb (%rsi), %al
movb %al, (%rdi)
movq %rdi, %rax
movq %rdx, -8(%rsp)
retq
.private_extern ___swift_noop_self_return
.globl ___swift_noop_self_return
.weak_definition ___swift_noop_self_return
.align 4, 0x90
___swift_noop_self_return:
movq %rdi, %rax
movq %rsi, -8(%rsp)
retq
.private_extern ___swift_memcpy_array1_1
.globl ___swift_memcpy_array1_1
.weak_definition ___swift_memcpy_array1_1
.align 4, 0x90
___swift_memcpy_array1_1:
subq $24, %rsp
shlq $0, %rdx
movq %rdi, 16(%rsp)
movq %rcx, 8(%rsp)
callq _memcpy
movq 16(%rsp), %rax
addq $24, %rsp
retq
.private_extern ___swift_memmove_array1_1
.globl ___swift_memmove_array1_1
.weak_definition ___swift_memmove_array1_1
.align 4, 0x90
___swift_memmove_array1_1:
subq $24, %rsp
shlq $0, %rdx
movq %rdi, 16(%rsp)
movq %rcx, 8(%rsp)
callq _memmove
movq 16(%rsp), %rax
addq $24, %rsp
retq
.private_extern __TwxsO6output4Hoge
.globl __TwxsO6output4Hoge
.weak_definition __TwxsO6output4Hoge
.align 4, 0x90
__TwxsO6output4Hoge:
.cfi_startproc
pushq %rbp
Ltmp27:
.cfi_def_cfa_offset 16
Ltmp28:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp29:
.cfi_def_cfa_register %rbp
movb %sil, %al
addb $2, %al
movb %al, (%rdi)
movq %rdx, -8(%rbp)
popq %rbp
retq
.cfi_endproc
.private_extern __TwxgO6output4Hoge
.globl __TwxgO6output4Hoge
.weak_definition __TwxgO6output4Hoge
.align 4, 0x90
__TwxgO6output4Hoge:
.cfi_startproc
pushq %rbp
Ltmp30:
.cfi_def_cfa_offset 16
Ltmp31:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp32:
.cfi_def_cfa_register %rbp
movl $4294967295, %eax
movzbl (%rdi), %ecx
subl $2, %ecx
cmpl $0, %ecx
cmovll %eax, %ecx
movl %ecx, %eax
movq %rsi, -8(%rbp)
popq %rbp
retq
.cfi_endproc
.private_extern __TwugO6output4Hoge
.globl __TwugO6output4Hoge
.weak_definition __TwugO6output4Hoge
.align 4, 0x90
__TwugO6output4Hoge:
.cfi_startproc
pushq %rbp
Ltmp33:
.cfi_def_cfa_offset 16
Ltmp34:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp35:
.cfi_def_cfa_register %rbp
movb (%rdi), %al
andb $1, %al
movzbl %al, %eax
movq %rsi, -8(%rbp)
popq %rbp
retq
.cfi_endproc
.private_extern __TwupO6output4Hoge
.globl __TwupO6output4Hoge
.weak_definition __TwupO6output4Hoge
.align 4, 0x90
__TwupO6output4Hoge:
.cfi_startproc
pushq %rbp
Ltmp36:
.cfi_def_cfa_offset 16
Ltmp37:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp38:
.cfi_def_cfa_register %rbp
movq %rdi, -8(%rbp)
movq %rsi, -16(%rbp)
popq %rbp
retq
.cfi_endproc
.private_extern __TwuiO6output4Hoge
.globl __TwuiO6output4Hoge
.weak_definition __TwuiO6output4Hoge
.align 4, 0x90
__TwuiO6output4Hoge:
.cfi_startproc
pushq %rbp
Ltmp39:
.cfi_def_cfa_offset 16
Ltmp40:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp41:
.cfi_def_cfa_register %rbp
movb %sil, %al
andb $1, %al
movb %al, (%rdi)
movq %rdx, -8(%rbp)
popq %rbp
retq
.cfi_endproc
.section __TEXT,__text,regular,pure_instructions
.align 4, 0x90
l_get_field_types_Hoge:
.cfi_startproc
pushq %rbp
Ltmp42:
.cfi_def_cfa_offset 16
Ltmp43:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Ltmp44:
.cfi_def_cfa_register %rbp
subq $48, %rsp
movq l_field_type_vector_Hoge(%rip), %rax
cmpq $0, %rax
movq %rdi, -8(%rbp)
movq %rax, -16(%rbp)
jne LBB19_3
xorl %eax, %eax
movl %eax, %ecx
movl $7, %eax
movl %eax, %esi
movq %rcx, %rdi
movq %rcx, -24(%rbp)
callq _swift_slowAlloc
movq %rax, %rcx
movq %rax, %rsi
movq -24(%rbp), %rdi
movq %rax, -32(%rbp)
movq %rdi, %rax
movq -32(%rbp), %rdx
lock cmpxchgq %rdx, l_field_type_vector_Hoge(%rip)
sete %r8b
testb $1, %r8b
movq %rcx, -40(%rbp)
movq %rax, -48(%rbp)
movq %rsi, -16(%rbp)
jne LBB19_3
xorl %eax, %eax
movl %eax, %esi
movl $7, %eax
movl %eax, %edx
movq -40(%rbp), %rdi
callq _swift_slowDealloc
movq -48(%rbp), %rdx
movq %rdx, -16(%rbp)
LBB19_3:
movq -16(%rbp), %rax
addq $48, %rsp
popq %rbp
retq
.cfi_endproc
.globl __TMaO6output4Hoge
.align 4, 0x90
__TMaO6output4Hoge:
pushq %rbp
movq %rsp, %rbp
leaq __TMfO6output4Hoge(%rip), %rax
addq $8, %rax
popq %rbp
retq
.section __DATA,__const
.globl __TWPO6output4Hoges9EquatableS_
.align 3
__TWPO6output4Hoges9EquatableS_:
.quad __TTWO6output4Hoges9EquatableS_ZFS1_oi2eefTxx_Sb
.globl __TWPO6output4Hoges8HashableS_
.align 3
__TWPO6output4Hoges8HashableS_:
.quad __TWPO6output4Hoges9EquatableS_
.quad __TTWO6output4Hoges8HashableS_FS1_g9hashValueSi
.globl __TWVO6output4Hoge
.align 3
__TWVO6output4Hoge:
.quad ___swift_noop_void_return
.quad ___swift_memcpy1_1
.quad ___swift_noop_self_return
.quad ___swift_noop_void_return
.quad ___swift_noop_void_return
.quad ___swift_memcpy1_1
.quad ___swift_memcpy1_1
.quad ___swift_memcpy1_1
.quad ___swift_memcpy1_1
.quad ___swift_memcpy1_1
.quad ___swift_memcpy1_1
.quad ___swift_noop_self_return
.quad ___swift_memcpy1_1
.quad ___swift_noop_void_return
.quad ___swift_memcpy_array1_1
.quad ___swift_memmove_array1_1
.quad ___swift_memmove_array1_1
.quad 1
.quad 2359296
.quad 1
.quad 254
.quad __TwxsO6output4Hoge
.quad __TwxgO6output4Hoge
.quad __TwugO6output4Hoge
.quad __TwupO6output4Hoge
.quad __TwuiO6output4Hoge
.section __TEXT,__cstring,cstring_literals
L___unnamed_1:
.asciz "O6output4Hoge"
.section __TEXT,__const
l___unnamed_2:
.asciz "Next\000Error\000"
.section __DATA,__const
.globl __TMnO6output4Hoge
.align 3
__TMnO6output4Hoge:
.quad 2
.quad L___unnamed_1
.long 0
.long 2
.quad l___unnamed_2
.quad l_get_field_types_Hoge
.quad 0
.long 0
.long 0
.long 0
.space 4
.align 3
__TMfO6output4Hoge:
.quad __TWVO6output4Hoge
.quad 2
.quad __TMnO6output4Hoge
.quad 0
.section __TEXT,__swift2_proto,regular,no_dead_strip
.align 3
l_protocol_conformances:
.long __TMps9Equatable@GOTPCREL+5
.long (__TMfO6output4Hoge+8)-(l_protocol_conformances+4)
.long __TWPO6output4Hoges9EquatableS_-(l_protocol_conformances+8)
.long 1
.long __TMps8Hashable@GOTPCREL+5
.long (__TMfO6output4Hoge+8)-(l_protocol_conformances+20)
.long __TWPO6output4Hoges8HashableS_-(l_protocol_conformances+24)
.long 1
.zerofill __DATA,__bss,l_field_type_vector_Hoge,8,3
.no_dead_strip __TTWO6output4Hoges9EquatableS_ZFS1_oi2eefTxx_Sb
.no_dead_strip __TTWO6output4Hoges8HashableS_FS1_g9hashValueSi
.no_dead_strip __TWPO6output4Hoges9EquatableS_
.no_dead_strip __TWPO6output4Hoges9EquatableS_
.no_dead_strip __TWaO6output4Hoges9EquatableS_
.no_dead_strip __TWPO6output4Hoges8HashableS_
.no_dead_strip __TWaO6output4Hoges8HashableS_
.no_dead_strip __TWVO6output4Hoge
.no_dead_strip __TMnO6output4Hoge
.no_dead_strip __TMaO6output4Hoge
.no_dead_strip __TMfO6output4Hoge
.no_dead_strip l_protocol_conformances
.linker_option "-lswiftCore"
.linker_option "-lobjc"
.section __DATA,__objc_imageinfo,regular,no_dead_strip
L_OBJC_IMAGE_INFO:
.long 0
.long 768
.globl __TMO6output4Hoge
.alt_entry __TMO6output4Hoge
__TMO6output4Hoge = __TMfO6output4Hoge+8
.subsections_via_symbols
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment