This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Add extra location information - PR43486
- From: Arnaud Charlet <charlet at adacore dot com>
- To: Manuel LÃpez-IbÃÃez <lopezibanez at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>, Joseph Myers <joseph at codesourcery dot com>, Aldy Hernandez <aldyh at redhat dot com>, Paolo Carlini <paolo dot carlini at oracle dot com>
- Date: Sun, 4 Nov 2012 18:15:18 +0100
- Subject: Re: [PATCH] Add extra location information - PR43486
- References: <20120918105831.GA15097@adacore.com> <CAESRpQDHAmZap9u8Ye1Sy3n-TsZR_QK06cTN03v13Tnmj+USVg@mail.gmail.com>
> I think, in the long-term, your proposed approach is less useful than
> fixing early folding and adding locations (via a wrapper or an
> on-the-side index) to the tree nodes that don't have one. But, since
> nobody is working on the latter, the "long term" may be longer than
> the time until someone makes a LLVM-to-GIMPLE conversor, and replaces
> the C/C++ FEs by clang. ;-)
Given the current state of front end trees and LLVM, I suspect indeed most people interested in e.g. static analysis will likely switch to LLVM if not already done.
> So, as a short-term fix, your proposed
> approach is definitely better than the status-quo, so I hope you
> manage to get it finished.
Unfortunately the suggestions I received, while they make sense on paper require a large amount of work, which I can hardly justify for now and certainly not in the short term. I suspect it would take me less time to redo my work using LLVM than to introduce a whole new API/kludge on top of gcc locations, with also still a large unknown as to whether my new patch would be accepted without yet another large rewrite.
Or to put it another way, it does not really make much more sense to me to use pseudo locations than my current htable approach (it only marginally improves things, for a large development effort), in particular since a better solution would be to have a real C and C++ AST, which I suspect GCC will end up having sooner or later (e.g. via clang as you hinted).