Live data from Hacker News

Extracting the abstract syntax tree from GCC

lwn.net

111–112 of 112 posts

Re: Extracting the abstract syntax tree from GCC

#111

Earlier quoted context omitted.

> In BSD and similar you easily can. Nope. My taking BSD code and producing a proprietary, closed source product it in no way impacts someone else's freedom to do the same, nor does it remove some freedom they previously had.

The freedoms on the original are indeed unchanged in both cases. The freedom on the derived work is what can be taken away with non-GPL.

There was never any freedom on the derived work to begin with, so no freedom can be taken away. Especially considering that in practice people don't just take a look at a project they might derive a project from, see the GPL license and go "Huh, I guess I have to use GPL then".

The GPL nerd imagination in play here is as the ridiculous as the imagination of crypto nerds[1].

[1]: http://xkcd.com/538/

Re: Extracting the abstract syntax tree from GCC

#112

Earlier quoted context omitted.

> LLVM doesn't have an intermediate representation comparable to Gimple: LLIR seems to be at the level of the registers rather than the nice abstract Gimple LLVM variables are sometimes called registers but they are machine independent. The bit width is arbitrary (e.g., you can create a 129-bit integer). The use of the term register is a misleading analogy; often LLVM-IR is compared to assembly language so the use of…

Will have to take another look, but it still sounds to me like LLVM IR is more comparable to RTL ( https://gcc.gnu.org/onlinedocs/gccint/RTL.html#RTL ). Gimple variables have types comparable with C types - you get pointers, arrays. For example: int sum10(int values[10]) { int i; int sum = 0; for(i=0;i is compiled down to: sum10 (int * values) { long unsigned int D.1598; long unsigned int D.1599; int * D.1600; int D.…

As far as I know, LLVM does exactly the same thing; the LLVM representation of that code would have a different syntax of course, but semantically would be exactly equivalent to the Gimple version you've presented.
Post reply on HN