Desktop tool to quickly explore and analyze Swift Intermediate Representation (IR) generated by the LLVM compiler, and also generate assembly code.
- Deep Code Understanding: Developers can see how Swift code is transformed into both LLVM IR and assembly code, helping them better understand optimization and low-level behavior.
- Advanced Debugging: Viewing LLVM IR and assembly can help identify performance issues or hard-to-trace bugs in source code.
- Education and Learning: A valuable educational tool for learning about compilers and how different language constructs translate into intermediate representation and assembly.
- Optimization: Helps identify and optimize code snippets that are not compiling efficiently by providing insights from both LLVM IR and assembly.
- Comparative Analysis: Allows you to compare how different approaches or code versions generate different IR and assembly code, facilitating the choice of best coding practices.
- IA Gemini: You can see how to improve your code and compare LVVM and Assembly with the help of Gemini.
Important
To review the details through Gemini, you must generate an API Key through this link.
Onone:
Compile without any optimization.Osize:
Compile with optimizations and target small code size.Ounchecked:
Compile with optimizations and remove runtime safety checks.O:
Compile with optimizations.
Download the dmg - click here
Please see the documentation
Install mise
mise install
Generate SwiftExplorer.xcworkspace
with Tuist
tuist install
tuist generate
This project was inspired by kotlin-explorer developed by Romain Guy.
If you have any questions about the kotlin-explorer tool, I recommend you watch the talk Practical Optimizations - Romain Guy
swift-explorer is released under the MIT license. See LICENSE for details.