Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
SwiftのDemanglerを書く @ わいわいswiftc番外編
Search
ukitaka
December 15, 2018
Programming
510
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SwiftのDemanglerを書く @ わいわいswiftc番外編
ukitaka
December 15, 2018
More Decks by ukitaka
See All by ukitaka
あなたの知らない「動画広告」の世界 - iOSDC Japan 2025
ukitaka
0
1.9k
CSの生産性改善を支える分析環境 Mercari CS/CRE Tech Talk #1
ukitaka
1
3.1k
switchのexhaustiveness/redundancy チェック 理論と実装 わいわいswiftc #8 @ukitaka
ukitaka
0
270
Swiftの型システムに入門する - iOSDC Japan 2018
ukitaka
10
7.5k
Responder Chainを使って コードをスッキリさせたい - 第1回 HAKATA.swift
ukitaka
6
1.5k
理論から入門するswift/lib/Sema - わいわいswiftc #1
ukitaka
5
1.8k
Realmの処理を再利用可能かつ合成可能にする
ukitaka
0
1k
マルチスレッドRxSwift @ 社内RxSwift勉強会
ukitaka
5
1.3k
今日こそ理解するHot / Cold @社内RxSwift勉強会
ukitaka
14
3k
Other Decks in Programming
See All in Programming
GitHubハンズオン講座 — 実務レベルのチーム開発のフローを身につけよう
junhat6
0
110
AHC070解法紹介
eijirou
0
150
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
180
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
750
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
300
App Intentsのビルドプロセスを支える技術
kntkymt
0
490
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
210
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
520
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
570
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
600
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
270
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
120
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
1
240
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
390
Abbi's Birthday
coloredviolet
4
10k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
GitHub's CSS Performance
jonrohan
1033
470k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
900
Discover your Explorer Soul
emna__ayadi
2
1.3k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
66k
Practical Orchestrator
shlominoach
192
12k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
510
Automating Front-end Workflow
addyosmani
1369
210k
Transcript
Θ͍Θ͍swiftc൪֎ฤ @ukitaka SwiftͷDemanglerΛॻ͘
ࠓͷඪ
$S13ExampleNumber6isEven6numberSbSi_tF isEven(number: Int) -> Bool Ψν
Mangle / Demangleͱ Mangleͱ $S13ExampleNumber6isEven6numberSbSi_tF ExampleNumber.swift ͷ isEven(number: Int) ->
Bool
Mangle / Demangleͱ Demangleͱ $S13ExampleNumber6isEven6numberSbSi_tF ExampleNumber.isEven(number: Swift.Int) -> Swift.Bool
Mangle / Demangleͱ Mangle͞ΕͨγϯϘϧ໊Λ֬ೝ͢Δ $ swiftc -emit-sil Examples/ExampleNumber.swift
Mangle / Demangleͱ Mangle͞ΕͨγϯϘϧ໊Λ֬ೝ͢Δ $ swiftc -emit-sil Examples/ExampleNumber.swift
Mangle / Demangleͱ SwiftͷDemangleίϚϯυ $ swift demangle '$S13ExampleNumber6isEven6numberSbSi_tF' $S13ExampleNumber6isEven6numberSbSi_tF —>
ExampleNumber.isEven(number: Swift.Int) -> Swift.Bool
Mangle / Demangleͱ SwiftͷDemangleίϚϯυ $ swift demangle '$S13ExampleNumber6isEven6numberSbSi_tF' $S13ExampleNumber6isEven6numberSbSi_tF —>
ExampleNumber.isEven(number: Swift.Int) -> Swift.Bool ࠓ͜ΕΛ࡞Γ·͢
Demangler Demangler ▸ Demanglerͷ࡞Λ௨ͯ͠ҎԼΛֶ΅͏ ▸ SwiftͷManglingͷΈΛֶͿ ▸ ؆୯ͳParserΛ࡞͢ΔͷͰɺParserͷςΫχοΫΛମݧͰ͖Δ
Swift Demangler workshop ՝ʹ͍ͭͯ ▸ جຊ֤ࣗREADMEΛΈͳ͕ΒਐΊͯΒ͍·͢ ▸ ՝1ʙ5·Ͱ͋Γɺ՝1Λશһ͕ୡ͢Δ͜ͱΛඪʹ͠·͢ ▸ ՝1ʹαϙʔτ͕͍ͭͯΔͷͰɺͦΕΛΈͳ͕ΒͬͯΈ·͠ΐ͏
▸ Ͱ͖ΔਓͲΜͲΜਐΊͯΒͬͯେৎͰ͢ ▸ ಛʹ5ͷsubstitutionॏཁͳͱ͜ΖͳͷͰ
՝1
Swift Demangler workshop ՝1 $S13ExampleNumber6isEven6numberSbSi_tF ExampleNumber.isEven(number: Swift.Int) -> Swift.Bool
Swift Demangler workshop ՝1 $S13ExampleNumber6isEven6numberSbSi_tF SwiftͷMangle nameʹڞ௨Ͱͭ͘Prefix
Swift Demangler workshop ՝1 $S13ExampleNumber6isEven6numberSbSi_tF ؔΛMangleͨ͠ͷͰ͋Δͱ͍͏ҹ F
Swift Demangler workshop ՝1 $S13ExampleNumber6isEven6numberSbSi_tF “ExampleNumber” ͱ͍͏Ϟδϡʔϧ໊ (ϑΝΠϧ໊) 13͔͜͜Β13จࣈ͕ࣝผࢠͰ͋Δ͜ͱΛද͢
Swift Demangler workshop ՝1 $S13ExampleNumber6isEven6numberSbSi_tF “isEven” ͱ͍͏ؔͷ໊લ 6จࣈ͕ࣝผࢠͰ͋Δ͜ͱΛࣔ͢
Swift Demangler workshop ՝1 $S13ExampleNumber6isEven6numberSbSi_tF “number” ͱ͍͏ϥϕϧ 6จࣈ͕ࣝผࢠͰ͋Δ͜ͱΛࣔ͢
Swift Demangler workshop ՝1 $S13ExampleNumber6isEven6numberSbSi_tF ؔͷγάωνϟ (≒ ܕ) SbฦΓͷܕ Bool
Si_tҾͷܕ (Int)
Swift Demangler workshop ՝1 global ::= entity entity ::= context
entity-spec context ::= module module ::= identifier $S13ExampleNumber6isEven6numberSbSi_tF global
Swift Demangler workshop ՝1 global ::= entity entity ::= context
entity-spec context ::= module module ::= identifier $S13ExampleNumber6isEven6numberSbSi_tF global entity
Swift Demangler workshop ՝1 global ::= entity entity ::= context
entity-spec context ::= module module ::= identifier $S13ExampleNumber6isEven6numberSbSi_tF context entity-spec module
Swift Demangler workshop ՝1 entity-spec ::= decl-name label-list function-signature 'F'
function-signature ::= params-type params-type throws? label-list ::= empty-list label-list ::= ('_' | identifier)* throws ::= 'K' params-type ::= type decl-name ::= identifier identifier ::= NATURAL IDENTIFIER-STRING $S13ExampleNumber6isEven6numberSbSi_tF decl-name label-list function-signature
Swift Demangler workshop ՝1 (࠶ܝ) $S13ExampleNumber6isEven6numberSbSi_tF ExampleNumber.isEven(number: Swift.Int) -> Swift.Bool