[LLVMdev] Static ctors in llvm::Attribute

Kostya Serebryany kcc at google.com
Tue Feb 7 13:29:20 PST 2012


On Tue, Feb 7, 2012 at 12:53 PM, Kostya Serebryany <kcc at google.com> wrote:

> I see the problem.
> Let me try to come up with a solution that does not involve constructors
> but also does not sacrifice type safety.
>
>
>
I have a patch that uses a proxy POD type. 'make && make check' passes.
It's a bit ugly in the header file (include/llvm/Attributes.h), but does
not require any changes in the rest of the code,
is typesef and Attributes retain the default CTOR (i.e. no uninitialized
Attributes objects).

If the approach is ok, I'll this patch (formatted and commented) for
further review.

--kcc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120207/ebbc0eeb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: attr.patch
Type: text/x-patch
Size: 7791 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120207/ebbc0eeb/attachment.bin>


More information about the llvm-dev mailing list