summaryrefslogtreecommitdiffstats
path: root/libcxx/src/iostream.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Only initialize the streams cout/wcout/cerr/wcerr etc once, rather than any ↵Marshall Clow2019-09-131-2/+17
| | | | | | time Init::Init is called. Fixes PR#43300 llvm-svn: 371864
* Speculative fix for std stream destruction order on Windows.Eric Fiselier2019-05-221-0/+21
| | | | | | | | | | | | | | | The MSVC CRT uses TLS storage to implement per-thread locales. This storage gets freed during program termination, and if we attempt to do any io operations (like flushing the std streams) after this occurs the program may abort. This patch is a speculative fix for that issue. The fix tries forcing the initialization of the locale TLS before initializing the std streams. This should mean that the TLS is freed after we destroy the streams. llvm-svn: 361348
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* Make libc++'s versioning namespace customizableEric Fiselier2018-10-301-9/+9
| | | | | | | | | | | | | | | | | Summary: This patch makes the versioning namespace libc++ uses customizable by the user using `-DLIBCXX_ABI_NAMESPACE=__foo`. This allows users to build custom versions of libc++ which can be linked into binaries with other libc++ versions without causing symbol conflicts or ODR issues. Reviewers: mclow.lists, ldionne Reviewed By: ldionne Subscribers: kristina, smeenai, mgorny, phosek, libcxx-commits Differential Revision: https://reviews.llvm.org/D53879 llvm-svn: 345657
* [libc++] Make sure we can build libc++ with -fvisibility=hiddenLouis Dionne2018-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: When building with -fvisibility=hidden, some symbols do not get exported from libc++.dylib. This means that some entities are not explicitly given default visibility in the source code, and that we rely on the fact -fvisibility=default is the default. This commit explicitly gives default visibility to those symbols to avoid being dependent on the command line flags used. The commit also remove symbols from the dylib -- those symbols do not actually need to be exported from the dylib and this should not be an ABI break. Finally, in the future, we may want to mark the whole std:: namespace as having hidden visibility (to switch from opt-out to opt-in), in which case the changes done in this commit will be required. Reviewers: EricWF Subscribers: mgorny, christof, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D52662 llvm-svn: 345260
* [libc++] Don't hardcode namespace in manual manglingShoaib Meenai2017-08-071-8/+12
| | | | | | | | | libc++'s inline namespace can change depending on the ABI version. Instead of hardcoding __1 in the manual Microsoft ABI manglings for the iostream globals, stringify _LIBCPP_NAMESPACE and use that instead, to work across all ABI versions. llvm-svn: 310290
* [libc++] Use _LIBCPP_ABI_MICROSOFT instead of _MSC_VERShoaib Meenai2017-04-191-8/+8
| | | | | | | | _LIBCPP_ABI_MICROSOFT is more appropriate to use here, since the conditionals are controlling Microsoft mangling. It wasn't used originally since it didn't exist at the time. llvm-svn: 300743
* Explicitly specify MSVC mangling of iostream globals. Patch from Dave LeeEric Fiselier2017-01-071-10/+42
| | | | llvm-svn: 291337
* Make the presence of stdin and stdout optional.Ed Schouten2015-03-261-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea behind Nuxi CloudABI is that it is targeted at (but not limited to) running networked services in a sandboxed environment. The model behind stdin, stdout and stderr is strongly focused on interactive tools in a command shell. CloudABI does not support the notion of stdin and stdout, as 'standard input/output' does not apply to services. The concept of stderr does makes sense though, as services do need some mechanism to log error messages in a uniform way. This patch extends libc++ in such a way that std::cin and std::cout and the associated <cstdio>/<cwchar> functions can be disabled through the flags _LIBCPP_HAS_NO_STDIN and _LIBCPP_HAS_NO_STDOUT, respectively. At the same time it attempts to clean up src/iostream.cpp a bit. Instead of using a single array of mbstate_t objects and hardcoding the array indices, it creates separate objects that declared next to the iostream objects and their buffers. The code is also restructured by interleaving the construction and setup of c* and wc* objects. That way it is more obvious that this is done identically. The c* and wc* objects already have separate unit tests. Make use of this fact by adding XFAILs in case libcpp-has-no-std* is set. That way the tests work in both directions. If stdin or stdout is disabled, these tests will therefore test for the absence of c* and wc*. Differential Revision: http://reviews.llvm.org/D8340 llvm-svn: 233275
* Remove the state_types array.Ed Schouten2015-03-261-8/+12
| | | | | | | | | | | | | | | If we want to add support for making std::cin and std::cout optional, it is impractical to have all of the mbstate_t objects in one array. This would mean that if std::cin and std::cout are omitted, the state_types array is only used partially. Solve this by using separate global variables. These are placed right next to the iostream object and the buffer, meaning we can easily #ifdef them away. Differential Revision: http://reviews.llvm.org/D8359 llvm-svn: 233274
* Clean up iostream creation in preparation for conditionalizing streams.Ed Schouten2015-03-171-18/+20
| | | | | | | | | | | | Interleave the code for narrow and wide character streams. This makes it more obvious that the two pieces of code are identical. Furthermore, it makes it easier to conditionally compile support for certain streams, as less #ifdef blocks are needed. Differential Revision: http://reviews.llvm.org/D8342 Reviewed by: marshall llvm-svn: 232516
* Nico Rieck: this patch series fixes visibility issues on Windows as ↵Howard Hinnant2013-08-121-8/+8
| | | | | | explained in <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-August/031214.html>. llvm-svn: 188192
* Use reinterpret_casts directly in place of C-style casts.Joerg Sonnenberger2013-04-271-4/+4
| | | | llvm-svn: 180679
* This is an optimization which produces improved launching time. There ↵Howard Hinnant2013-03-191-6/+8
| | | | | | should be no functionality change. Clients should see no ABI differences. llvm-svn: 177443
* Protect use of alignas against older versions of clangHoward Hinnant2012-05-311-14/+14
| | | | llvm-svn: 157764
* Alter the terminal streams such that they do not get added to the atexit ↵Howard Hinnant2012-03-161-25/+38
| | | | | | chain, and thus never get destructed. llvm-svn: 152926
* _STD -> _VSTD to avoid macro clash on windowsHoward Hinnant2011-06-301-2/+2
| | | | llvm-svn: 134190
* license changeHoward Hinnant2010-11-161-2/+2
| | | | llvm-svn: 119395
* Wiped out some non-ascii characters that snuck into the copyright.Howard Hinnant2010-05-111-1/+1
| | | | llvm-svn: 103516
* libcxx initial importHoward Hinnant2010-05-111-0/+53
llvm-svn: 103490
OpenPOWER on IntegriCloud