[llvm-dev] Is my strategy about right?

mats petersson via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 15 02:22:26 PDT 2015


See comments inline...

On 15 October 2015 at 07:19, Joachim Durchholz via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi all,
>
> I'm setting up for a compiler project using LLVM as a backend, and I need
> some feedback about the easiest ecosystem for that.
> I need to build compiler and run-time system. For now, a proof of concept
> that picks the low-hanging fruits of LLVM is fully adequate, I don't care
> too much whether that code has long-term value.
>
> I'd like your thoughts about the avenues I'm seeing right now:
>
> 1) Since my C++ is ancient, rusty, and moldy, and since I'm pretty fluent
> in Java, do it in Java. (I find those linkage discussions scary - seems
> like the situation didn't get better in the past 15 years, just more
> complicated.)
> Whether that's even viable depends a lot on how much of the LLVM API needs
> to be wrapped. Java used to suck badly at such wrappers; things have
> improved a lot since JNA became available, but of course it's still far
> from ideal.
> I'm not opposed to getting up to speed with C++ again though. It would be
> a useful thing to have in my CV after all.
>

It seems there isn't a current working Java LLVM interface. Which means you
either have to update/modernize some old project, or write your own. I'm no
C++ star, but it's not "greek" to me either. In my view, the LLVM
functionality isn't too difficult to get into, and if you know basic C++,
you can pretty much use the LLVM functionality.  My advice would be "use
C++".

There are Python interfaces to LLVM, which may help too, although I
personally haven't used them.

>
> 2) Use Clang for the compiler and runtime.
> 2a) Use precompiled binaries. (Are these even available?)
>

Depends on what you are runningo your code on. Probably.

> 2b) Compile Clang using gcc.
>
This certainly works.

> 2b1) Be extra paranoid, and use the Clang produced in (2b) to compile
> Clang again. (Is that worth the extra effort?)
>
Probably not worth it.

> 2b2) Consider gcc-compiled Clang good enough if it runs the tests.
> 2b3) Don't worry about testing, simply assume going to be all okay on an
> amd64-linux platform anyway.
>

Running clang-test and/or llvm-test is probably quick enough that it is
worth doing - at least the first build of LLVM/Clang.

>
> 3) Use gcc for the compiler and runtime.
> Um... not really. I want Clang's error messages, they are consistently
> being reported as vastly superior to those of gcc.
>

Your choice. I use clang, but the code compiles correctly with gcc (most of
the time...).

--
Mats

>
> Any thoughts and feedback appreciated.
>
> Regards,
> Jo
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151015/f51e510b/attachment.html>


More information about the llvm-dev mailing list