|
|
Subscribe / Log in / New account

Extracting the abstract syntax tree from GCC

Extracting the abstract syntax tree from GCC

Posted Jan 22, 2015 13:44 UTC (Thu) by mlopezibanez (guest, #66088)
Parent article: Extracting the abstract syntax tree from GCC

What is missing from the discussion and the article (and what any *active* GCC developer will tell you) is that the AST of GCC C/C++ FEs has fundamental limitations for source code analysis, specially for refactoring, thus, nobody should expect that dumping GCC AST will somehow magically allow Emacs hackers to not need to "hack on GCC for every feature we want to add to Emacs". Even motivated devs such as AdaCore and Mozilla have tried to use GCC AST and given up because it is not complete enough. It is not a question of dumping the AST or not: There is a huge amount of work to do before GCC's AST can be useful for any source code analysis.

In my humble opinion, given Clang vs. GCC status as FEs, even if GCC dumped its AST today, nobody in their sane mind will spend any effort whatsoever to build a GCC AST reader just to enable some proprietary source code analysis, middle-end optimization or target backend. (There are good reasons why each of these potential uses would not become easier by dumping GCC's AST).

As one of the GCC developers working during the last ten years on reducing the gap between GCC and Clang, I would suggest that Emacs developers who are happy with Clang should just use it to improve Emacs (I'm also an Emacs user!) and those that are unhappy with Clang should just join the GCC team and help us such that in some years, GCC could be an alternative. Anything else is just noise.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds