[cfe-dev] Reflection/metaparsing implem

Andrew Sutton via cfe-dev cfe-dev at lists.llvm.org
Tue Nov 12 05:01:14 PST 2019

> I argue the standards should be based on the clang AST.  Clean it up first
> of course — and yes that alone would be extraordinarily difficult.  But
> it’s also very difficult to build a gigantic parallel naming system for
> reflection properties.  And then to maintain it long term…
> Best to look hard at what lies ahead, and bite the bullet now.  Clean up
> the AST, define the standard via it.  (And c’mon we all know those AST
> nodes have a lot of flab to go with all their muscle; clang would benefit
> too after we all finish grumbling about the changes.)  Other compilers can
> do a parallel naming system or adjust their own ASTs to match clang’s
> naming system — doesn’t need to add any work for them.

This is a non-starter for standardization. There are significant and
generally incompatible differences in the internal representations of C++
among the different vendors and no will to standardize or even informally
adopt a common representation. Even if there were interest in doing so, the
engineering cost would be prohibitive, as it would essentially require
gutting and rewriting huge swaths of the compiler (and in GCC's case,
possibly the middle-end). Parallel naming is also unlikely because of
memory requirements.

You have the same problem with compiled module interfaces, which serialize
the internal representation.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20191112/d2a7c655/attachment.html>

More information about the cfe-dev mailing list