From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: LLVM and Ada Date: Fri, 21 Oct 2016 10:33:19 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <7eaadf74-c55f-4c00-8f13-bf027cce130e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 21 Oct 2016 10:33:19 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="732f3c3aeb71b2a4815fd2dd18d62206"; logging-data="5276"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19KIkpF4fF2oxqB8I1imGt0Vi1tzKGbuQk=" User-Agent: Pan/0.140 (Chocolate Salty Balls; GIT b8fc14e git.gnome.org/git/pan2) Cancel-Lock: sha1:agyEJlO3quzDmRaf0l4rSEeBV5U= Xref: news.eternal-september.org comp.lang.ada:32151 Date: 2016-10-21T10:33:19+00:00 List-Id: On Fri, 21 Oct 2016 01:32:03 -0700, vincent.diemunsch wrote: > Le jeudi 20 octobre 2016 20:20:44 UTC+2, Simon Clubley a écrit : > >> There is no viable Ada frontend for current versions of LLVM (AFAIK) >> although various people have looked at this. > > Thank you Simon for your answer. > > Why Gnat on LLVM has been abandoned ? My understanding is that it never worked *completely* - maybe it did on 32-bit but the 64-bit backend was giving problems, and there wasn't enough effort to resolve these issues and keep it up to date with newer LLVM releases. So if you can find the sources, they are (a) not completely functional and (b) increasingly obsolete (see Dennis' experience buisding with gcc versions back to 4.3) > Was LLVM less appropriate than GCC > for GNAT ? Yes. Roughly, the issue is that LLVM is designed to not support local subprograms (e.g. procedures declared local to other procedures, sharing the scope of the outer procedure). This limits its (easy) use to C-like languages, and if you are to support an Ada-like language you have to find ways round this problem. The DragonEgg compiler did have such support but as far as I know it was incomplete in some resperts - memory suggests, exception propagation didn't work properly for local subprograms, but I'm vague on the details. > My question precisely was not about the Ada frontend in fact but about a > binding to use the LLVM from an Ada program that is a sort of compiler. > I think that those who ported GNAT to LLVM should have created this kind > of binding, no ? This has been done. Not for Ada, but for a compiler written in Ada for another (somewhat) Ada- like language ... the ghdl compiler for VHDL. Here, local subprograms are supported, however VHDL doesn't have exceptions, so that specific bullet has been dodged. https://github.com/tgingold/ghdl GHDL is actively supported, and compiles VHDL to three differen compiler backends - gcc (upto 4.9), LLVM(3.5) and its own JIT compiler, mcode, all via its own intermediate language "ortho" (which is not normally written out to file, but can be written and read back in through the LLVM back end for compiler debugging purposes) So the compilation stage between "ortho" and the LLVM backend may be worth looking at, to help develop your own compiler. -- Brian