[cfe-dev] ASTMatchers.h and its internal linkage variable definitions

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 8 15:43:44 PST 2017


Hey Manuel,

In an effort to apply Modular Code Generation to Clang internally, I came
across the fact that this header contains a bunch of internal linkage
variables. (now, maybe modular code generation should be compatible with
internal linkage namespace-scoped variables... I'm looking into that)

These variables technically create ODR violations any time they're ODR-used
in another inline function used in more than one translation unit.

Is there a good way we could fix this header so it doesn't create ODR
violations (hopefully by not containing internal linkage entities)? I mean
one simple solution is to declare all these things in a header and define
them out of line. Since they have no actual state, that's probably pretty
low-cost except for a lot of duplication. I'm happy to use a .def/.inc file
to help remove a bunch of that duplication, if useful.

Open to ideas,

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


More information about the cfe-dev mailing list