[cfe-dev] LLVM Dev meeting: Slides & Minutes from the Static Analyzer BoF

David Chisnall via cfe-dev cfe-dev at lists.llvm.org
Tue Nov 3 09:46:03 PST 2015


On 3 Nov 2015, at 17:26, Manuel Klimek via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> 
> What are your arguments against implementing a type system on top of llvm IR (that lives on a similar level as debug info) that is not language specific per se, but allows frontends to model their language semantics and have pointers back to their AST? Do you believe such a type system would inherently be coupled to language semantics, and thus not possible to build in a generic enough (and still useful) way? Or are there other problems?

I don’t think that there’s anything wrong with the *idea* of doing this, but the implementation is very hard.  The CIR (not going to call it CIL) would, intrinsically, only support transforms that supported the generic C semantics and would know enough to update all C-relevant data.  When you lower to LLVM IR, even if you’re tagging everything with an AST node, you’d need all passes to understand how to update this information.  Given how badly most of them (even SROA / mem2reg, without which most analyses would be largely useless) do with debug info, which is at a far lower fidelity than this sort of thing would need, it’s very hard for me to imagine getting it right for a C AST, let alone a C++AST.

David




More information about the cfe-dev mailing list