[clang] [Clang] Add GCC's __builtin_stack_address() to Clang. (PR #121332)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 31 01:10:23 PST 2025


aalhwc wrote:

Thanks for all the comments!

> Should we be supporting STACK_ADDRESS_OFFSET similar to what GCC does?

Apologies for missing that. I'll have it ready before the next patch update.

> Other builtins [...] map onto an llvm intrinsic [...] What's the reason for not following this design for __builtin_stack_address?

> it feels like something that should be expressed portably as an IR intrinsic and then get lowered in the backend [...]

I wasn't aware of the direct mapping between the front end intrinsics and the llvm intrinsics. Implementing the llvm intrinsic `llvm.stackaddress` makes perfect sense. I'll try to have it ready before the next patch update. Thanks!

https://github.com/llvm/llvm-project/pull/121332


More information about the cfe-commits mailing list