*From: *Richard Smith <rich...@metafoo.co.uk> *Date: *Wed, May 15, 2019 at 5:43 PM
> On Wed, 15 May 2019 at 15:54, Reid Kleckner via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> We could probably re-land Richard's change (although it's quite a lot of >> code...), but... drop the conflicting `static` on the floor >> if hasLinkageBeenComputed() returns true. That would work around the >> assert, right? >> > > Yes, that seems like it could work, though I really don't like our > generated code depending on when we happen to compute linkage. In the MIDL > case, are there any uses of the global between the 'extern' declaration and > the 'static' declaration? > Hm, there actually are uses, so I think my suggestion isn't enough. It makes sense, MIDL is creating forward decls so they can be referenced before they are defined. This is what I looked at: https://searchfox.org/mozilla-central/search?q=symbol:_Z34HandlerData__MIDL_TypeFormatString&redirect=false Why were we getting static linkage before anyway? We just happened to look at the last declaration instead of the first or canonical one when doing IRGen? In the context of C, downgrading from extern to static isn't such a big deal. We could only implement it for C, since that's what MSVC does. Given that this will require mutating IR that we've already created, I'd be willing to look into it further.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits