| Issue |
64662
|
| Summary |
[libc++] `__throw_bad_function_call` should be `cold` and `noinline`
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
Eisenwave
|
https://github.com/llvm/llvm-project/blob/a7d80c50aa9121bff08d59ab4c4d7210dd2400f9/libcxx/include/__functional/function.h#L75-L83
This function should ideally be marked `cold` and `noinline`, since throwing exceptions is meant to be expensive and unusual anyway, and inlining just increases the code size at the call site.
The [libstdc++ counterpart](https://github.com/gcc-mirror/gcc/blob/25be11e982c76200fabb375c8c63eff8c6856980/libstdc%2B%2B-v3/include/bits/functexcept.h#L114C10-L114C10) is marked `cold`, and is opaque, which prevents inlining.
```cpp
void
__throw_bad_function_call() __attribute__((__noreturn__,__cold__));
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs