[llvm] r192803 - Assert on duplicate registration. Don't depend on function pointer equality.

Rafael Espíndola rafael.espindola at gmail.com
Wed Oct 16 13:16:39 PDT 2013


On 16 October 2013 16:06, Sean Callanan <scallanan at apple.com> wrote:
> Rafael,
>
> how do you reconcile this patch with the text on IntiializeAllTargetMCs()
> (llvm/Support/TargetSelect.h) that says specifically:
>
>   /// It is legal for a client to make multiple calls to this function.
>
> LLDB in particular uses this because various of its subsystems depend on the
> TargetMCs being initialized and whoever gets to it first makes sure they
> are.  We try to avoid static constructors.
>
> I’d argue for reverting your patch as it breaks a declared interface
> contract.

OK, so this and our use of -fvisibility-inlines-hidden basically mean
that we cannot make any meaningful checks about the initialization. It
is probably best to just drop the asserts.

Is the attached patch OK for you?

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 5660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131016/c36e7203/attachment.obj>


More information about the llvm-commits mailing list