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
280
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
phperだってパンチカードでコーディングしたい
o0h
PRO
0
370
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
440
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
160
[2026-10-09]一枚の布で作らなくてもいい。 信頼性は「パッチワーク」で紡がれる~既存の運用と新しい可能性をつなぎ合わせてきたCREの話~
tosite
0
110
オーケストレーション記述言語 Katari
yukikurage
0
150
Domain-Driven Transformation
hschwentner
2
2.3k
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
170
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
820
Workers Cache を知る
syumai
0
370
sbt 2.0: takeoff
eed3si9n
0
170
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
140
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
410
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Everyday Curiosity
cassininazir
0
360
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
460
A better future with KSS
kneath
240
18k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Faster Mobile Websites
deanohume
310
32k
Writing Fast Ruby
sferik
630
63k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
330
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