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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,577ecbb6c5a53a1f X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.106.102 with SMTP id gt6mr2283863wib.0.1349942506747; Thu, 11 Oct 2012 01:01:46 -0700 (PDT) Path: q11ni134269320wiw.1!nntp.google.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!216.40.29.245.MISMATCH!novia!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: LLVM and GCC (was: Forking old GMGPL libs ?) Date: Sat, 06 Oct 2012 13:27:48 +0200 Organization: A noiseless patient Spider Message-ID: <87fw5rhmbv.fsf_-_@ludovic-brenta.org> References: <5de9a47c-6594-4653-a083-38f90312e70e@googlegroups.com> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="bfc8171067f57009ca3c3b958f065a0f"; logging-data="20374"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+XuoPoiawsqOl2WsLN+C2A" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:HsVdo6sprcn+AQ6mjcKalIGidNw= sha1:yV7HgFJfxq3CHiZMpn+IoCbDGxc= Content-Type: text/plain; charset=us-ascii Date: 2012-10-06T13:27:48+02:00 List-Id: Brian Drummond writes on comp.lang.ada: > I am currently trying to get GHDL to build with gcc 4.7; it last built > successfully with gcc4.3.4 or so. Like Gnat, it is written mostly in > Ada, with a thin layer of C between it and the GCC internals. However > it is about an order of magnitude smaller than Gnat. I'm glad you're doing this; the package ghdl in Debian unstable is stale and is the last one that still requires gnat-4.4; all other Ada packages have migrated to gnat-4.6 long ago. > As to targetting Clang versus LLVM, I haven't looked at Clang. But > LLVM looked to me like a virtual machine (asm-like) rather than a > syntax tree (AST like Generic or Gimple in gcc terms). Which to me, > would raise the question of whether the LLVM back end can do the > optimisations you want. LLVM is both the virtual machine and an intermediate representation[1]. Contrary to GCC, LLVM's IR is serializable: one can save it to disk and re-load it into the virtual machine for ahead-of-time or just-in-time compilation. LLVM is also a good optimizer that works on that IR; just not yet as good as GCC. The IR is, I think, better designed than that of GCC because it was designed from the onset as language-neutral and very rich. The IR of GCC was initially designed for C only and was later extended in ad hoc ways for other languages. [1] http://llvm.org/docs/LangRef.html A hypothetical Ada front-end for LLVM needs only emit this well-specified IR. Duncan Sands once made such an Ada front-end based on the Ada front-end in GCC 4.2. I'm not sure how this worked at the time; I suppose Duncan replaced the GCC interface you mentioned with an LLVM interface. This has now been superseded by DragonEgg, whereby the GCC Ada front-end feeds its AST into LLVM, which then translates it to its IR, runs its optimizers and emits the final assembly. -- Ludovic Brenta.