Slide 20
Slide 20 text
*3(FO
swiftc -emit-ir 1.swift
1.swift
let a = 1
; ModuleID = '-'
source_filename = "-"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.14.0"
%TSi = type <{ i64 }>
@"$s4main1aSivp" = hidden global %TSi zeroinitializer, align 8
@"_swift_FORCE_LOAD_$_swiftCompatibility50_$_main" = weak_odr hidden constant void ()* @"_swift_FORCE_LOAD_$_swiftCompatibility50"
@"_swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_main" = weak_odr hidden constant void ()* @"_swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements"
@__swift_reflection_version = linkonce_odr hidden constant i16 3
@llvm.used = appending global [3 x i8*] [i8* bitcast (void ()** @"_swift_FORCE_LOAD_$_swiftCompatibility50_$_main" to i8*), i8* bitcast (void ()** @"_swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_main" to i8*), i8* bitcast
(i16* @__swift_reflection_version to i8*)], section "llvm.metadata", align 8
define i32 @main(i32, i8**) #0 {
entry:
%2 = bitcast i8** %1 to i8*
store i64 1, i64* getelementptr inbounds (%TSi, %TSi* @"$s4main1aSivp", i32 0, i32 0), align 8
ret i32 0
}
declare extern_weak void @"_swift_FORCE_LOAD_$_swiftCompatibility50"()
declare extern_weak void @"_swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements"()
attributes #0 = { "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "target-cpu"="penryn" "target-features"="+cx16,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" }
!llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
!swift.module.flags = !{!9}
!llvm.linker.options = !{!10, !11, !12, !13, !14}
!llvm.asan.globals = !{!15}
!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 10, i32 15]}
!1 = !{i32 1, !"Objective-C Version", i32 2}
!2 = !{i32 1, !"Objective-C Image Info Version", i32 0}
!3 = !{i32 1, !"Objective-C Image Info Section", !"__DATA,__objc_imageinfo,regular,no_dead_strip"}
!4 = !{i32 4, !"Objective-C Garbage Collection", i32 83953408}
!5 = !{i32 1, !"Objective-C Class Properties", i32 64}
!6 = !{i32 1, !"wchar_size", i32 4}
!7 = !{i32 7, !"PIC Level", i32 2}
!8 = !{i32 1, !"Swift Version", i32 7}
!9 = !{!"standard-library", i1 false}
!10 = !{!"-lswiftSwiftOnoneSupport"}
!11 = !{!"-lswiftCore"}
!12 = !{!"-lobjc"}
!13 = !{!"-lswiftCompatibility50"}
!14 = !{!"-lswiftCompatibilityDynamicReplacements"}
!15 = !{[3 x i8*]* @llvm.used, null, null, i1 false, i1 true}