[mpich-discuss] Extensible Clang type annotation
Jed Brown
jedbrown at mcs.anl.gov
Wed Jan 2 13:43:35 CST 2013
On Wed, Jan 2, 2013 at 1:23 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> Unfortunately we can not, because user-defined datatypes are
> syntactically different from builtin datatypes in MPICH. MPI_INT is a
> macro, so what Clang sees is essentially a magic number. With
> user-defined datatypes there's an identifier (MyEnumDatatype) that
> actually shows up in the AST. There's a separate quirk in Clang for
> handling these magic numbers and corresponding 'static const'
> variables (not needed for OpenMPI, btw).
>
Okay, makes sense.
> > so that the symbols are guaranteed to only show up once in
> > executables (rather than once per compilation unit)?
>
> A smart enough compiler (and Clang is smart enough) will eliminate
> those even at -O0.
>
Okay, gcc also removes them with optimization. Thanks, Dmitri.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20130102/dd86e931/attachment.html>
More information about the discuss
mailing list