[cfe-dev] A new builtin: __builtin_stack_pointer()

Chris Lattner clattner at apple.com
Fri Nov 8 13:13:49 PST 2013


On Nov 6, 2013, at 5:46 PM, Behan Webster <behanw at converseincode.com> wrote:
> Another way would be to introduce a new builtin in parallel to others
> like __builtin_return_address(). Essentially adding a
> __builtin_stack_pointer() which does what the above code does. The idea
> would be to get something like this added to both clang and gcc in order
> to make this work across compilers, and across arches.
> 
> It ends up being a trivial patch for clang (see below). We're still
> looking for someone to help us on the gcc side.

>From my perspective, adding __builtin_stack_pointer() makes perfect sense.  Mapping it to Intrinsic::stacksave does not though, it should map down to a new llvm.stackpointer() intrinsic, and the code generator should turn it into the stack pointer register at isel time.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131108/649daaf7/attachment.html>


More information about the cfe-dev mailing list