libc++: First cut at <dynarray>

Chandler Carruth chandlerc at google.com
Thu Sep 12 20:31:09 PDT 2013


On Thu, Sep 12, 2013 at 8:29 PM, Chandler Carruth <chandlerc at google.com>wrote:

> Furthermore, I don't why this would not be trivial to implement:
>>
>>  1. We add an intrinsic, like alloca, called alloca_in_caller. This is
>> only allowed in functions marked always_inline.
>>  2. To the analysis passes, alloca_in_caller looks like malloc
>>  3. When the inliner inlines a alloca_in_caller call, it transforms it
>> into an alloca call
>>
>> (and that's it I think). Perhaps I'm way off base, but it seems fairly
>> simple. Is there anything else that's needed?
>>
>
> You don't need any of the inline stuff. You just need some builtin which
> directly produces a dynamically sized alloca instruction and the
> stacksave/stackrestore pair to manage its lifetime.
>

Ugh, that's a lie. You need to be able to use this builtin and generate the
stack save and stack restore bits in constructors and destructors. Yuck.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130912/26df66db/attachment.html>


More information about the cfe-commits mailing list