-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc]: Clean up unnecessary function pointers in scanf #121215
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
Merged
michaelrj-google
merged 25 commits into
llvm:main
from
vinay-deshmukh:vinay-issue-115394
Feb 20, 2025
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
885d874
Initial moves
vinay-deshmukh 12f2ae0
Remove duplicate definition
vinay-deshmukh 6236e59
Doesn't build but should in CI
vinay-deshmukh d12a8f5
Merge branch 'main' into vinay-issue-115394
vinay-deshmukh f3b8d7f
clang-format patch
vinay-deshmukh bfe6b86
Put overlay include last
vinay-deshmukh 90ce1b2
Merge branch 'main' into vinay-issue-115394
vinay-deshmukh 1f9e27c
Attempt to fix linker error
vinay-deshmukh 1bd2181
Merge branch 'main' into vinay-issue-115394
vinay-deshmukh 0abb5c3
try reorder
vinay-deshmukh 13f418d
Move getc back to header
vinay-deshmukh d3c3329
Merge commit 'f9369cc' into vinay-issue-115394
vinay-deshmukh fe6f638
WIP ???
vinay-deshmukh cbe1ab0
it works with COMPILE_OPTIONS param
vinay-deshmukh 09194c2
clean header file
vinay-deshmukh a459d11
use same logic as vfscanf_internal
vinay-deshmukh 6144b00
avoid name lookup ambiguity
vinay-deshmukh 97ae074
clang-format patch
vinay-deshmukh 76f6a31
Remove reader.cpp
vinay-deshmukh 12696d4
Merge remote-tracking branch 'upstream/main' into vinay-issue-115394
vinay-deshmukh b02a039
Possibly redundant dependency for GPU
vinay-deshmukh 82ccee6
fix COMPILE_OPTIONS for vfscanf_internal
vinay-deshmukh 6f14edc
Add the right guards
vinay-deshmukh 5c45508
Merge branch 'main' into vinay-issue-115394
vinay-deshmukh 4539ae8
Remove extra spaces
vinay-deshmukh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is missing the dependency on
libc.src.__support.File.file
, as well as the flag controlling if it's using the system file. You'll also need to set up proper handling for the GPU like whatvfscanf_internal
has.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.
I seem to be getting an error like (after adding the above change):
is that expected on a M1 mac?
using the build commands from:#115394 (comment)
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.
ah, that's because we only support overlay mode on mac, and overlay mode doesn't have
FILE
. You'll need to add logic to only addlibc.src.__support.File.file
to the list ofDEPENDS
ifLLVM_LIBC_FULL_BUILD
is true.Uh oh!
There was an error while loading. Please reload this page.
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.
So, I think there's a bug / typo in the CMake call there.
Instead of:
it should be:
I think is what caused my build to have the bugs with macOS' system stdio.h macros
Link to code:
llvm-project/libc/src/stdio/scanf_core/CMakeLists.txt
Lines 119 to 121 in 106c483
I can add the
COMPILE_OPTIONS
in this PR if that's oK?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
COMPILE_OPTIONS
shouldn't be necessary, becauseuse_system_file
already contains it, see: https://github.com/llvm/llvm-project/blob/main/libc/src/stdio/CMakeLists.txt#L30