-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc] abs is a const function #79650
Conversation
@llvm/pr-subscribers-libc Author: AtariDreams (AtariDreams) ChangesFull diff: https://github.com/llvm/llvm-project/pull/79650.diff 1 Files Affected:
diff --git a/libc/src/stdlib/abs.h b/libc/src/stdlib/abs.h
index 19cef1446bd36df..ccfdccf2024a9e7 100644
--- a/libc/src/stdlib/abs.h
+++ b/libc/src/stdlib/abs.h
@@ -11,7 +11,7 @@
namespace LIBC_NAMESPACE {
-int abs(int n);
+int __attribute__((__const__)) abs(int n);
} // namespace LIBC_NAMESPACE
|
@michaelrj-google Do we have a formalized way to specify attributes? My gut says it should go in |
I have no idea how to do it in tablegen |
As it stands, this won't be exported. The header modified is simply the internal header. The installed ones go through a tool called |
I was asking Michael, because I recall that this is an existing issue that the infrastructure hasn't solved yet. I had problems earlier where it conflicted with a lot of GNU definitions that expect things like |
We have internal versions of math kernels inside |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approval is to dismiss previous "Request changes". I don't know how to dismiss a "Request changes" without approving the PR.
Isn't #79891 trying to add generalized support for attributes? |
I think the attributes on the installed headers and the internal headers are separate. |
No description provided.