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.152.134.52 with SMTP id ph20mr7088lab.4.1349940791490; Thu, 11 Oct 2012 00:33:11 -0700 (PDT) Path: q11ni134268989wiw.1!nntp.google.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.130.MISMATCH!xlned.com!feeder1.xlned.com!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!backlog2.nntp.dca.giganews.com!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: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: Forking old GMGPL libs ? Date: Sat, 6 Oct 2012 09:45:38 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <5de9a47c-6594-4653-a083-38f90312e70e@googlegroups.com> Mime-Version: 1.0 Injection-Date: Sat, 6 Oct 2012 09:45:38 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="0e44dd4a3c4e0a6e83a86f947fb780ae"; logging-data="7265"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/fTImoe0KtHWNCFB6M14t3Rtum9qWvuIo=" User-Agent: Pan/0.135 (Tomorrow I'll Wake Up and Scald Myself with Tea; GIT 30dc37b master) Cancel-Lock: sha1:Gof598LGb0xQlva9sa74HPUqzIQ= X-Original-Bytes: 3561 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 2012-10-06T09:45:38+00:00 List-Id: On Fri, 05 Oct 2012 15:51:04 -0700, Patrick wrote: > This is total crack smok'in, I hardly know anything about the clang > compiler and don't have the time of intelligence to fork GNAT but does > anyone think it would be technically possible to retool GNAT's to output > clang's AST. Hi Patrick. I'm not going to comment on licensing issues, but since I am in the process of messing about in the gcc front end for another project: Grab the gcc sources and look for yourself. The GNAT compiler is in the gcc/ada folder and it is HUGE. However there is a separate folder labelled "gcc-interface" containing only 17 files. Unfortunately these are all in C and some of them are quite large. Central to the interface is "struct lang-hooks" in misc.c and the defines around it. For example, "gnat_parse_file" is the hook into the main parser. Hopefully this is written in Ada and exported to the C layer... This will give you an idea of the size of the project. Looking at it, I am glad my project is much smaller, and even that would have been too much for a first gcc project. 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. There have been a couple of suggestions on the GHDL-discuss mailing list that GHDL would have been better re-written in C or C++. These take no account of the fact that the porting difficulty has ALL been in the existing C code (2% or so), the 98% written in Ada has not needed a single change... 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. The benefit of targeting Generic or Gimple is that you can then run GCC's extensive optimisation tools before descending to machine output. One would hope that Clang can do similar optimisations, given a tree. But I don't know the answer to that. It looked to me as if LLVM could not; and the DragonEgg plugin for GCC to let it output LLVM (after optimisation) suggests there is a need for a good optimiser ahead of LLVM. I would be delighted if someone could show me otherwise... - Brian