[llvm-dev] Replace MCTargetOptionsCommandFlags.inc and CommandFlags.inc by runtime registration

Serge Guelton via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 19 13:12:38 PDT 2020


On Wed, Mar 18, 2020 at 11:46 PM David Blaikie <dblaikie at gmail.com> wrote:

>
> Not sure if this makes it less likely someone will abuse the mechanic/make
> the same mistake as had happened before & declare the registration object
> at namespace scope in a library rather than only in executables.
> <https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
>

If I'm not mistaken, even that should be ok. If the object is registered in
a library *and* in the main executable, there will be two calls to the
constructor registered in the ELF constructor. Whatever the order, the
first one will initialize the static options from its constructor, and the
second won't, so no conflict.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200319/7908efa0/attachment.html>


More information about the llvm-dev mailing list