[LLVMdev] Writing LLVM front-end

Reid Kleckner rnk at google.com
Wed Feb 18 10:38:04 PST 2015


On Wed, Feb 18, 2015 at 10:20 AM, Hayden Livingston <halivingston at gmail.com>
wrote:

> I'm also a beginner, so asking on this beginner thread -- is there
> anything in addition to the C ABI that one needs to worry about? I imagine
> a C ABI gives lots of free libraries to integrate into your language, etc.
>

Being able to match the local C ABI is generally good enough for most
languages. It makes it easy to implement the language runtime in C, and let
you build an FFI to external libraries.

However, if you want to leverage libraries in another language like C++ or
Obj-C, it may be worth doing more work to allow deeper interoperability, as
is done in Swift for Obj-C. See the "Skip the FFI" dev meeting talk:
http://llvm.org/devmtg/2014-10/#talk18


> Also the C ABI change on platforms? I thought C Calling convention was the
> same on all platforms.
>

It is definitely different. However, if you're just passing scalar values
(ints, floats, and pointers), then LLVM will more or less abstract it all
away for you. If you pass aggregates, the frontend needs to know the
platform calling convention and how LLVM implements it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150218/391a5290/attachment.html>


More information about the llvm-dev mailing list