[patch] Assert on duplicate registration. Don't depend on function pointer equality

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Oct 14 16:55:36 PDT 2013


We currently assert when building llvm as multiple shared libraries
(cmake's BUILD_SHARED_LIBS). The problem is the line

if (T.AsmStreamerCtorFn == Target::createDefaultAsmStreamer)

which returns false because of -fvisibility-inlines-hidden. It is easy
to fix just this one case, but I decided to try to also make the
registration more strict. It looks like the current logic for ignoring
followup registration was just a temporary hack that outlived its
usefulness.

The attached patch converts the ifs to asserts, fixes the few cases
that were registering twice and make sure all the asserts compare with
null.

Thanks for Joerg for reporting the problem.

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


More information about the llvm-commits mailing list