Add dontthrow attribute to most libc functions

This will help C++ code that uses exceptions to be tinier. For example,
this change shaves away 1000 lines of assembly code from LLVM's libcxx,
which is 0.7% of all assembly instructions in the entire library.
This commit is contained in:
Justine Tunney 2024-01-09 01:26:03 -08:00
parent cb19e172da
commit eeb20775d2
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
103 changed files with 1455 additions and 1456 deletions

View file

@ -13,19 +13,19 @@ struct dirent { /* linux getdents64 abi */
struct dirstream;
typedef struct dirstream DIR;
DIR *fdopendir(int) __wur;
DIR *opendir(const char *) __wur;
int closedir(DIR *);
int dirfd(DIR *);
long telldir(DIR *);
struct dirent *readdir(DIR *);
int readdir_r(DIR *, struct dirent *, struct dirent **);
void rewinddir(DIR *);
void seekdir(DIR *, long);
int alphasort(const struct dirent **, const struct dirent **);
int versionsort(const struct dirent **, const struct dirent **);
DIR *fdopendir(int) libcesque __wur;
DIR *opendir(const char *) libcesque __wur;
int closedir(DIR *) libcesque;
int dirfd(DIR *) libcesque;
long telldir(DIR *) libcesque;
struct dirent *readdir(DIR *) libcesque;
int readdir_r(DIR *, struct dirent *, struct dirent **) libcesque;
void rewinddir(DIR *) libcesque;
void seekdir(DIR *, long) libcesque;
int alphasort(const struct dirent **, const struct dirent **) libcesque;
int versionsort(const struct dirent **, const struct dirent **) libcesque;
int scandir(const char *, struct dirent ***, int (*)(const struct dirent *),
int (*)(const struct dirent **, const struct dirent **));
int (*)(const struct dirent **, const struct dirent **)) libcesque;
COSMOPOLITAN_C_END_
#endif /* COSMOPOLITAN_LIBC_CALLS_STRUCT_DIRENT_H_ */