3 ms·
LLVM already has a C API: http://llvm.org/docs/doxygen/html/group__LLVMC.html http://llvm.org/docs/doxygen/html/group__LLVMC.html It's less full-featured than
by nostrademons 11y ago
LLVM already has a C API:
http://llvm.org/docs/doxygen/html/group__LLVMC.html http://llvm.org/docs/doxygen/html/group__LLVMC.html
It's less full-featured than the C++ API, though, and may not help Swift all that much. Swift interoperates seamlessly with Objective-C, but its C FFI requires a lot of awkward boilerplate to translate between types & calling conventions.
LLVM can also parse serialized bitcode, so one option (in any language) is always to dump to serialized LLVM bitcode and then pipe it to llc on stdin. Performance will suffer, though, since you have to serialize & deserialize the bitcode.