[LLVMdev] anchoring explicit template instantiations
David Blaikie
dblaikie at gmail.com
Mon Dec 19 18:55:00 PST 2011
On Mon, Dec 19, 2011 at 5:40 PM, Chris Lattner <clattner at apple.com> wrote:
> On Dec 10, 2011, at 5:20 PM, David Blaikie wrote:
>>>> Thanks Chris, committed as r145578. I don't suppose you'll mind some
>>>> similar commits as I encounter them?
>>>
>>> Yep, please feel free.
>>
>> While you said this - given that I've now gone & fixed /every/
>> violation of -Wweak-vtables across LLVM & Clang (apart from some llvm
>> target tblgen problems - not sure how practical they are to fix. And
>> gtest also fires this warning) I thought I should probably get at
>> least a '*nod*' before I check this in.
>
> Looks fine to me, please do.
Done & done (r146959 in clang, r146960 in llvm)
>> (also, I implemented this by adding private anchors, like my original
>> version - this does actually have a difference at runtime, of course -
>> since now each of these types has another entry in their vtable.
>
> I think that's a perfectly fine cost :)
>
>> Alternatively I could've used their destructors (but then they
>> wouldn't be inline anymore - but probably most of them are called
>> virtually anyway so their inline-ness doesn't matter). Also I had to
>> add about 10 source files in total as implementation files for
>> header-only cases that needed anchors)
>
> Losing an inlined dtor would be a bigger cost.
>
>> Also - do we have anywhere we could put standard flags that LLVM
>> should successfully compile with? At least if clang is being used,
>> perhaps? So we could add -Wweak-vtables -Werror for this case & add
>> more as we deem it appropriate.
>
> Makefile.rules is the right place, but we don't have great autoconf logic to detect what flags the host compiler supports (at least as far as I know).
Fair enough - can't say I know too much about autoconf magic but I
might look into it one day.
- David
More information about the llvm-dev
mailing list