comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Drummond <brian@shapes.demon.co.uk>
Subject: Re: LLVM and Ada
Date: Fri, 21 Oct 2016 10:33:19 -0000 (UTC)
Date: 2016-10-21T10:33:19+00:00	[thread overview]
Message-ID: <nucqtf$54s$1@dont-email.me> (raw)
In-Reply-To: fdcc461d-0800-42e5-a130-a31a7edd5e3b@googlegroups.com

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




  reply	other threads:[~2016-10-21 10:33 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20 14:28 LLVM and Ada Vincent DIEMUNSCH
2016-10-20 18:20 ` Simon Clubley
2016-10-21  8:32   ` vincent.diemunsch
2016-10-21 10:33     ` Brian Drummond [this message]
2016-10-21 12:25       ` vincent.diemunsch
2016-10-22 12:31       ` Lucretia
2016-10-21 13:47     ` jparkerg000
2016-10-21 18:33       ` vincent.diemunsch
2016-10-22 12:51     ` Lucretia
2016-10-25 14:34       ` Vincent
2018-03-21 13:08         ` carlojpisani
2018-03-21 14:40           ` Dan'l Miller
2018-03-21 18:23             ` Bojan Bozovic
2018-03-21 18:57               ` Luke A. Guest
2018-03-22 13:57                 ` Dan'l Miller
2018-03-22 15:18                   ` Luke A. Guest
2018-03-22 17:01                     ` Dan'l Miller
2018-03-22 21:14                       ` Luke A. Guest
2018-03-22 21:28                         ` Dan'l Miller
2018-03-22 21:36                           ` Dan'l Miller
2018-03-22 22:14                             ` Luke A. Guest
2018-03-22 23:37                               ` Dan'l Miller
2018-03-22 23:50                                 ` Lucretia
2018-03-22 23:58                                   ` Dan'l Miller
2018-03-23  5:10                                     ` Bojan Bozovic
2018-03-23 14:25                                       ` Dan'l Miller
2018-03-23 14:38                                         ` Dan'l Miller
2018-03-23 16:38                                           ` Shark8
2018-03-25  2:17                                             ` Dan'l Miller
2018-03-25 16:56                                               ` Lucretia
2018-03-25 10:29                                             ` Bojan Bozovic
2018-03-25 11:01                                               ` Bojan Bozovic
2018-03-25 16:58                                               ` Lucretia
2018-03-23 16:43                                       ` Lucretia
2018-03-30 20:46                             ` Dan'l Miller
2018-03-22 12:22           ` Brian Drummond
2016-10-20 23:31 ` Dennis Lee Bieber
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox