[libc] Fix typo and amend restrict qualifier (#152410)

This removes an extraneous ',' in the generated dlfcn header.

This also adds `__restrict` to `dladdr`'s declaration per POSIX. Another
fix is made: the C standard `restrict` keyword is removed from
dlinfo.cpp/dlinfo.h (but note that dlfcn.yaml still annotates
`__restrict` for dlinfo's decl).
This commit is contained in:
Caslyn Tonelli 2025-08-07 16:45:14 -07:00 committed by GitHub
parent 27ed1f99e2
commit b8195e3a8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 13 additions and 9 deletions

View File

@ -46,7 +46,7 @@ enums:
standards:
- gnu
value: 2
- name: RTLD_DI_CONFIGADDR,
- name: RTLD_DI_CONFIGADDR
standards:
- gnu
value: 3
@ -127,5 +127,5 @@ functions:
- POSIX
return_type: int
arguments:
- type: const void *
- type: Dl_info *
- type: const void *__restrict
- type: Dl_info *__restrict

View File

@ -14,7 +14,8 @@
namespace LIBC_NAMESPACE_DECL {
// TODO: https:// github.com/llvm/llvm-project/issues/97929
LLVM_LIBC_FUNCTION(int, dladdr, (const void *addr, Dl_info *info)) {
LLVM_LIBC_FUNCTION(int, dladdr,
(const void *__restrict addr, Dl_info *__restrict info)) {
return -1;
}

View File

@ -13,7 +13,7 @@
namespace LIBC_NAMESPACE_DECL {
int dladdr(const void *, Dl_info *);
int dladdr(const void *__restrict, Dl_info *__restrict);
} // namespace LIBC_NAMESPACE_DECL

View File

@ -16,7 +16,8 @@ namespace LIBC_NAMESPACE_DECL {
// TODO: https://github.com/llvm/llvm-project/issues/149911
LLVM_LIBC_FUNCTION(int, dlinfo,
(void *restrict handle, int request, void *restrict info)) {
(void *__restrict handle, int request,
void *__restrict info)) {
return -1;
}

View File

@ -13,7 +13,7 @@
namespace LIBC_NAMESPACE_DECL {
int dlinfo(void *restrict, int, void *restrict);
int dlinfo(void *__restrict, int, void *__restrict);
} // namespace LIBC_NAMESPACE_DECL

View File

@ -14,6 +14,8 @@
namespace LIBC_NAMESPACE_DECL {
// TODO(@izaakschroeder): https://github.com/llvm/llvm-project/issues/97920
LLVM_LIBC_FUNCTION(void *, dlsym, (void *, const char *)) { return nullptr; }
LLVM_LIBC_FUNCTION(void *, dlsym, (void *__restrict, const char *__restrict)) {
return nullptr;
}
} // namespace LIBC_NAMESPACE_DECL

View File

@ -13,7 +13,7 @@
namespace LIBC_NAMESPACE_DECL {
void *dlsym(void *, const char *);
void *dlsym(void *__restrict, const char *__restrict);
} // namespace LIBC_NAMESPACE_DECL