-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[TLI] Add support for reallocarray #114818
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ int stpncpy; | |
| int strdup; | ||
| int strndup; | ||
| int index; | ||
| int reallocarray; | ||
|
||
| int rindex; | ||
| int bzero; | ||
| int strcasecmp; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -852,6 +852,7 @@ static void initializeLibCalls(TargetLibraryInfoImpl &TLI, const Triple &T, | |
| TLI.setUnavailable(LibFunc_memrchr); | ||
| TLI.setUnavailable(LibFunc_ntohl); | ||
| TLI.setUnavailable(LibFunc_ntohs); | ||
| TLI.setUnavailable(LibFunc_reallocarray); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Since 2.29 under _DEFAULT_SOURCE and under _GNU_SOURCE" Can you check the version and comment this somewhere?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's from the manpage (e.g. https://man.archlinux.org/man/reallocarray.3.en). I'll update the commit message to make it clear.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean this needs to be documented in the code, not the commit message
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How did you determine whether this is available on PS?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I grepped the whole sdk (for PS4 though). Plenty of mention to |
||
| TLI.setUnavailable(LibFunc_reallocf); | ||
| TLI.setUnavailable(LibFunc_roundeven); | ||
| TLI.setUnavailable(LibFunc_roundevenf); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -318,6 +318,7 @@ TEST_F(TargetLibraryInfoTest, ValidProto) { | |
| "declare void @qsort(i8*, i64, i64, i32 (i8*, i8*)*)\n" | ||
| "declare i64 @readlink(i8*, i8*, i64)\n" | ||
| "declare i8* @realloc(i8*, i64)\n" | ||
| "declare i8* @reallocarray(i8*, i64, i64)\n" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test should be converted to opaque pointers
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ack. but that probably belongs to another commit, right?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
| "declare i8* @reallocf(i8*, i64)\n" | ||
| "declare double @remainder(double, double)\n" | ||
| "declare float @remainderf(float, float)\n" | ||
|
|
||
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.
The clang builtin change should be separate, and is not tested