Try installing LLVM precompiled by simply running brew install llvm using Homebrew .
NOTE. I highly recommend using a Swift shell such as LLVMSwift , in which case you should follow the installation instructions from here. But if you want to directly access LLVM yourself, read on.
Add /usr/local/opt/llvm/include in the header search path and /usr/local/opt/llvm/lib to your library search path under the desired goal of your project in the "Build Settings" section:

And drag /usr/local/opt/llvm/lib/libLLVM.dylib (open in Finder with open -R '/usr/local/opt/llvm/lib/libLLVM.dylib' ) in the "Related Structures and Libraries" section "General" (and make it "Required" as shown):

Finally, create an Objective-C Bridging Header header ( steps 1-2 in this guide if you don't know how to do this) and specify the headers you need (for example, #include <llvm-c/Core.h> ) : 
And you're all set! Just use any LLVM class, as usual in Swift code.
Coder256
source share