[cfe-dev] Extra join points in CFG?
Ted Kremenek
kremenek at apple.com
Wed Dec 21 17:50:07 PST 2011
On Dec 21, 2011, at 4:25 PM, Chandler Carruth wrote:
> On Wed, Dec 21, 2011 at 3:51 PM, Ted Kremenek <kremenek at apple.com> wrote:
> Thanks John. I discovered some of the issues by looking at the generated IR; looking at CodeGen was my next planned step.
>
> This again makes me wish that we could begin working to actually implement CodeGen in terms of the CFG so that we both share some of the burden of implementing this logic, and more importantly can share in the testing of the logic. Anyways, that's still more invasive, so I just wanted to keep people thinking about it...
>
>
> Cheers,
> Ted
>
I think there is strong merit in doing this, and this has been discussed (offline) before.
Historically, the design choice of having CodeGen and the CFG be independent came when the CFG was being used exclusively for the static analyzer. Thus the CFG wasn't needed for the compiler at all, and thus it was slightly faster to not build the CFG.
Only later, when we had a bunch of compiler warnings based on top of the CFG, did that base assumption here change. We still don't build CFGs for static inline functions in system headers (because we would suppress those warnings), but we don't do codegen for those functions all the time either.
Changing CodeGen to be built on top of the CFG would provide some great self-consistency, but there are tradeoffs (potential performance related) with the approach, not to mention that this would be a significant engineering project. If someone wants to play around with doing an alternate implementation of CodeGen based on the CFG, I would support such an effort. We can only evaluate that approach if we actually do it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111221/82306bd0/attachment.html>
More information about the cfe-dev
mailing list