[llvm] r264341 - [Support] Add ErrorInfo::ID static member definition.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 24 16:31:16 PDT 2016


On Thu, Mar 24, 2016 at 4:20 PM, Reid Kleckner via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Lang, see this thread where I tried to explain to Chandler why this
> pattern basically doesn't work if you expect this template to instantiated
> this template in multiple DLLs:
> https://groups.google.com/d/topic/llvm-dev/Bo-I7aRS3CA/discussion
>
> You're trying to ask the loader to coalesce a weak global symbol across
> DSOs, and that's not something the Windows loader will do for you.
>

Presumably "will /not/ do for you"


>
> Also, it's bad for startup performance on other platforms. I've heard
> Chris Bieneman go on about how this kind of symbol is banned in some
> contexts at Apple.
>
> I think you can solve the problem the same way I suggested that Chandler
> do it: make the derived error classes responsible for providing this
> symbol, and have classID() return &ThisErrT::ID.
>

Pretty unfortunate additional boilerplate (perhaps moreso in the pass
manager than in the error categories, not sure which we'll end up with more
of in the long run), but if that's the nearest we can do...


>
> On Thu, Mar 24, 2016 at 4:08 PM, NAKAMURA Takumi via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Lang, sorry for the issue. r264293 missed useful descriptions.
>>
>> A static member's definition cannot be unified among DLLs in Win32 DLL
>> model, that has just "dllexport" and "dllimport".
>>
>> Although Chandler is proposing to drop supporting Win32 DLL
>> configuration, I would like to watch and support it.
>> I am still seeking how to get "class ID" in better way on that
>> configuration.
>>
>>
>> On Fri, Mar 25, 2016 at 7:16 AM Alexey Samsonov <vonosmas at gmail.com>
>> wrote:
>>
>>> Some confusion is going on here. See r264293 which deleted these
>>> definitions. As a result, I now have "multiple definitions" error while
>>> trying to link ErrorTest
>>>
>>> On Thu, Mar 24, 2016 at 2:17 PM, Lang Hames via llvm-commits <
>>> llvm-commits at lists.llvm.org> wrote:
>>>
>>>> Author: lhames
>>>> Date: Thu Mar 24 16:17:50 2016
>>>> New Revision: 264341
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=264341&view=rev
>>>> Log:
>>>> [Support] Add ErrorInfo::ID static member definition.
>>>>
>>>> Somehow this got dropped in an earlier patch.
>>>>
>>>>
>>>> Modified:
>>>>     llvm/trunk/include/llvm/Support/Error.h
>>>>
>>>> Modified: llvm/trunk/include/llvm/Support/Error.h
>>>> URL:
>>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Error.h?rev=264341&r1=264340&r2=264341&view=diff
>>>>
>>>> ==============================================================================
>>>> --- llvm/trunk/include/llvm/Support/Error.h (original)
>>>> +++ llvm/trunk/include/llvm/Support/Error.h Thu Mar 24 16:17:50 2016
>>>> @@ -291,6 +291,9 @@ private:
>>>>    static char ID;
>>>>  };
>>>>
>>>> +template <typename ThisErrT, typename ParentErrT>
>>>> +char ErrorInfo<ThisErrT, ParentErrT>::ID = 0;
>>>> +
>>>>  /// Special ErrorInfo subclass representing a list of ErrorInfos.
>>>>  /// Instances of this class are constructed by joinError.
>>>>  class ErrorList final : public ErrorInfo<ErrorList> {
>>>>
>>>>
>>>> _______________________________________________
>>>> llvm-commits mailing list
>>>> llvm-commits at lists.llvm.org
>>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>>>
>>>
>>>
>>>
>>> --
>>> Alexey Samsonov
>>> vonosmas at gmail.com
>>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160324/c8fc98fb/attachment.html>


More information about the llvm-commits mailing list