iOS 开发

iOS ~ 编译 Clang 、swiftc 、LLVM

2019-01-23  本文已影响23人  派大星的博客

推荐阅读:

https://llvm.org
https://medium.com/@jyaunches/introduction-to-the-llvm-for-a-ios-engineer-8c00ed0f9ff0
https://swift.org/compiler-stdlib/#compiler-architecture
https://medium.com/@JMangia/swift-c-llvm-compiler-optimization-842012568bb7
https://zhuanlan.zhihu.com/p/49274308
https://juejin.im/post/5a352bb0f265da433562d5e3
https://blog.csdn.net/Hello_Hwc/article/details/53557308
https://developer.apple.com/videos/play/wwdc2018/415/
https://developer.apple.com/videos/play/wwdc2018/408

Presentation Slides (PDF) 下载


图解编译

“front end” — “back end”.jpeg

Swift Abstract Syntax Tree (AST)

Swift Intermediate Language (SIL)

LLVM Intermediate Representation (LLVM IR)

Assembly Language

What is Clang?

Apple’s official for the C language family
C
C++
Objective-C
Objective-C++

编译.png 编译 链接.png

What is swiftc?

屏幕快照 2019-01-23 下午12.18.53.png 屏幕快照 2019-01-23 下午12.23.12.png image.png

在xcode按下cmd+B之后的工作流程:

image.png

What is LLVM?

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. Despite its name, LLVM has little to do with traditional virtual machines. The name "LLVM" itself is not an acronym; it is the full name of the project.

⚠️注意

The LLVM Project 是模块化、可重用的编译器和工具链技术的集合。包含多个子项目。其中包括我们熟悉的ClangLLDB

除了LLVM的官方子项目之外,还有许多其他项目使用LLVM的组件来执行各种任务。通过这些外部项目,您可以使用LLVM来编译Ruby,Python,Haskell,Java,D,PHP,Pure,Lua和许多其他语言。LLVM的主要优势在于其多功能性,灵活性和可重用性,这就是它被用于各种不同任务的原因:从轻量级JIT编译嵌入式语言(如Lua)到编译Fortran代码(用于大型超级)电脑。

上一篇 下一篇

猜你喜欢

热点阅读