[libc] fix line buffered empty file writesPreviously, any line buffered write of size 0 would cause an error.The variable used to track the index of the last newline started atthe size of the wri
[libc] fix line buffered empty file writesPreviously, any line buffered write of size 0 would cause an error.The variable used to track the index of the last newline started atthe size of the write - 1, which underflowed. Now it's handled properly,and a test has been added to prevent regressions.Reviewed By: sivachandra, lntueDifferential Revision: https://reviews.llvm.org/D127914
show more ...
[libc] add buffering to FILE writesPreviously all FILE objects were fully buffered, this patch adds linebuffering and unbuffered output, as well as applying them to stdout andstderr.Reviewed By
[libc] add buffering to FILE writesPreviously all FILE objects were fully buffered, this patch adds linebuffering and unbuffered output, as well as applying them to stdout andstderr.Reviewed By: sivachandraDifferential Revision: https://reviews.llvm.org/D126829
[libc] Implement FLAGS option for generating all combinations for targets.Add FLAGS option for add_header_library, add_object_library,add_entrypoint_object, and add_libc_unittest.In general, a f
[libc] Implement FLAGS option for generating all combinations for targets.Add FLAGS option for add_header_library, add_object_library,add_entrypoint_object, and add_libc_unittest.In general, a flag is a string provided for supported functions under themulti-valued option `FLAGS`. It should be one of the following forms: FLAG_NAME FLAG_NAME__NO FLAG_NAME__ONLYA target will inherit all the flags of its upstream dependency.When we create a target `TARGET_NAME` with a flag using (add_header_library,add_object_library, ...), its behavior will depend on the flag form as follow:- FLAG_NAME: The following 2 targets will be generated: `TARGET_NAME` that has `FLAG_NAME` in its `FLAGS` property. `TARGET_NAME.__NO_FLAG_NAME` that depends on `DEP.__NO_FLAG_NAME` if `TARGET_NAME` depends on `DEP` and `DEP` has `FLAG_NAME` in its `FLAGS` property.- FLAG_NAME__ONLY: Only generate 1 target `TARGET_NAME` that has `FLAG_NAME` in its `FLAGS` property.- FLAG_NAME__NO: Only generate 1 target `TARGET_NAME.__NO_FLAG_NAME` that depends on `DEP.__NO_FLAG_NAME` if `DEP` is in its DEPENDS list and `DEP` has `FLAG_NAME` in its `FLAGS` property.To show all the targets generated, pass SHOW_INTERMEDIATE_OBJECTS=ON to cmake.To show all the targets' dependency and flags, pass`SHOW_INTERMEDIATE_OBJECTS=DEPS` to cmake.To completely disable a flag FLAG_NAME expansion, set the variable`SKIP_FLAG_EXPANSION_FLAG_NAME=TRUE`.Reviewed By: michaelrj, sivachandraDifferential Revision: https://reviews.llvm.org/D125174
[libc] Add global stdout and stderr objects.They are added as entrypoint object targets. The header-geninfrastructure has been extended to enable handling standard requiredglobal objects. The lib
[libc] Add global stdout and stderr objects.They are added as entrypoint object targets. The header-geninfrastructure has been extended to enable handling standard requiredglobal objects. The libc-api-test has also been extended to verify theglobal object declarations.Reviewed By: lntueDifferential Revision: https://reviews.llvm.org/D126329
[libc] Add LINK_LIBRARIES option to add_fp_unittest and add_libc_unittest.This is needed to prepare for adding FLAGS option.Reviewed By: sivachandraDifferential Revision: https://reviews.llvm.o
[libc] Add LINK_LIBRARIES option to add_fp_unittest and add_libc_unittest.This is needed to prepare for adding FLAGS option.Reviewed By: sivachandraDifferential Revision: https://reviews.llvm.org/D125055
[libc][obvious] only test FILE on working platformsThe main code for the FILE struct is only enabled on platforms that itworks on, but before this patch the tests were included unconditionally.R
[libc][obvious] only test FILE on working platformsThe main code for the FILE struct is only enabled on platforms that itworks on, but before this patch the tests were included unconditionally.Reviewed By: sivachandra, lntueDifferential Revision: https://reviews.llvm.org/D122363
[libc][File] Fix a bug under fseek(..., SEEK_CUR).Reviewed By: lntueDifferential Revision: https://reviews.llvm.org/D122284
[libc] Add a linux file implementation.Reviewed By: lntueDifferential Revision: https://reviews.llvm.org/D121976
[libc][NFC] Keep the mutex with the base File data structure.This is now possible because we have a platform independent abstractionfor mutexes.Reviewed By: lntue, michaelrjDifferential Revisi
[libc][NFC] Keep the mutex with the base File data structure.This is now possible because we have a platform independent abstractionfor mutexes.Reviewed By: lntue, michaelrjDifferential Revision: https://reviews.llvm.org/D121773
[libc] Make the errno macro resolve to the thread local variable directly.With modern architectures having a thread pointer and language supportingthread locals, there is no reason to use a functi
[libc] Make the errno macro resolve to the thread local variable directly.With modern architectures having a thread pointer and language supportingthread locals, there is no reason to use a function intermediary to accessthe thread local errno value.The entrypoint corresponding to errno has been replaced with an objectlibrary as there is no formal entrypoint for errno anymore.Reviewed By: jeffbailey, michaelrjDifferential Revision: https://reviews.llvm.org/D120920
[libc] Add a platform independent buffered file IO data structure.Reviewed By: lntueDifferential Revision: https://reviews.llvm.org/D119458