Slide 13
Slide 13 text
LLVM IR
$ swiftc -emit-ir a.swift
// let i = 1
; ModuleID = ''
source_filename = ""
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-macosx14.0.0"
%TSi = type <{ i64 }>
@"$s1a1iSivp" = hidden global %TSi zeroinitializer, align 8
@"\01l_entry_point" = private constant { i32, i32 } { i32 trunc (i64 sub (i64 ptrtoint (ptr @main to i64), i64 ptrtoint (ptr @"\01l_entry_point" to
i64)) to i32), i32 0 }, section "__TEXT, __swift5_entry, regular, no_dead_strip", align 4
@__swift_reflection_version = linkonce_odr hidden constant i16 3
@llvm.used = appending global [3 x ptr] [ptr @main, ptr @"\01l_entry_point", ptr @__swift_reflection_version], section "llvm.metadata"
define i32 @main(i32 %0, ptr %1) #0 {
entry:
store i64 1, ptr @"$s1a1iSivp", align 8
ret i32 0
}
13 — Open Source Swift Workshop, try! Swift Tokyo 2024, @kitasuke