A modernized showcase of using LLVM and Clang to provide native JIT scripting capabilities in an iOS application.
This project demonstrates how to embed the LLVM/Clang interpreter (ORC JIT) into a SwiftUI-based iOS app. It allows you to write C++ code directly on your iPad or iPhone, compile it in-memory, and execute it using a modernized bridge.
- LLVM 15+ Integration: Uses modern ORC JIT APIs.
- Robust Build System: Modular
build-llvm.shscript replacing complex legacy Xcode steps. - Universal XCFrameworks: Supports iOS Device, Simulator (Intel/Apple Silicon), and Mac Catalyst.
- Modern SwiftUI UI: Optimized for iOS 15.0+.
To use this project, you need LLVM.xcframework and libffi.xcframework.
Our new modular build script handles fetching sources, building for all architectures, and packaging.
chmod +x build-llvm.sh
./build-llvm.sh libffi-all
./build-llvm.sh llvm-allRequires Xcode 16.4+, CMake, and Ninja.
Download the latest XCFrameworks from our GitHub Releases and place them in the root directory.
Sample/: The iOS Application source code.Interpreter.cpp: The C++ core that manages the Clang Driver and ORC JIT.LLVMBridge.mm: Objective-C++ bridge that safely passes data between Swift and C++.ContentView.swift: SwiftUI interface for code editing and result display.
build-llvm.sh: The unified build script for all dependencies.
- JIT & Code Signing: iOS generally prevents executing unsigned code in memory (JIT).
- Tethered Execution: The JIT interpreter works perfectly when the app is launched from Xcode (via the debugger).
- Untethered Execution: To run JIT untethered, you typically need specific entitlements (e.g.,
com.apple.developer.kernel.get-task-allow). Without these, the OS may terminate the app on JIT execution due to security policies.
This project is provided with NO license attached—feel free to use, modify, and distribute it for any purpose.

