[PATCH] MS ABI: Treat dllimport explicit specializations as inline

Richard Smith richard at metafoo.co.uk
Fri May 30 14:58:11 PDT 2014


On Thu, May 29, 2014 at 5:57 PM, Nico Rieck <nico.rieck at gmail.com> wrote:

> On 29.05.2014 23:25, Richard Smith wrote:
> > I find it a bit weird that we care in CodeGen whether a dllimport
> function
> > is marked as 'inline'. I would expect that either Sema should detect the
> > attribute has no effect and discard it, or it should keep it (and in the
> > latter case, CodeGen should respect it and not care whether the function
> is
> > marked 'inline'). Is there some reason that doesn't work?
>
> The first patch is bit backwards and unnecessarily complex. MSVC emits
> non-imported specializations with ODR linkage.
>
> So a simpler way to deal with this would be to just do what this mail's
> subject says and make such a specialization implictly inline which
> resolves correctly to available_externally without doing anything
> further. New patch attached.


Whether this is correct or not depends on the answer to my other question,
that you snipped from your reply:

"what linkage would MSVC give to an explicit specialization of a function
template under normal circumstances (no dllimport/dllexport attributes)?
Does it treat them as mergeable, like an inline function, or as a strong
definition?"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140530/c6044cf5/attachment.html>


More information about the cfe-commits mailing list