summaryrefslogtreecommitdiffstats
path: root/libcxx/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Make it possible to link against libstdc++ as well as libsupc++ with CMake.Peter Collingbourne2013-10-062-2/+6
| | | | | | | | | | | | | | | Linking against libstdc++, rather than libsupc++, is probably better for people who need to link against clients of libstdc++. Because libsupc++ is provided only as a static library, its globals are not shared between the static library and the copy linked into libstdc++. This has been found to cause at least one test failure. This also removes a number of symbols which were multiply defined between libstdc++ and libc++, only when linking with libstdc++. Differential Revision: http://llvm-reviews.chandlerc.com/D1825 llvm-svn: 192075
* Eliminate more symbols multiply defined between libsupc++ and libc++.Peter Collingbourne2013-10-062-1/+19
| | | | | | | | | | | | | | | The remaining multiple definitions were flushed out by attempting to link libsupc++ and libc++ into the same executable with --whole-archive, e.g. clang++ -I../llvm/projects/libcxx/include -nodefaultlibs -Wl,--whole-archive lib/libc++.a /usr/lib/gcc/x86_64-linux-gnu/4.6/libsupc++.a -Wl,--no-whole-archive -lgcc -lgcc_s -lc -lpthread -lrt (The same technique was used to flush out multiple definitions in libstdc++.) Differential Revision: http://llvm-reviews.chandlerc.com/D1824 llvm-svn: 192074
* Use _LIBCPP_NEW_DELETE_VIS instead of LIBCPP_FUNC_VIS in src/new.cpp.Howard Hinnant2013-10-061-8/+8
| | | | llvm-svn: 192071
* G M: The attached patch is for libcxx's new.cpp and __config files. The ↵Howard Hinnant2013-10-041-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | patch's intent is to make new.cpp compile using MS's cl.exe compiler without changing the meaning of anything for any other compiler. The issue this patch seeks to address is that MS's compiler (cl.exe) doesn't support the __attribute__((__weak__)) or __atribute__((__visibility__("default")) syntax; so a solution must be found where cl.exe doesn't see this syntax. This patch seeks to solve this problem by changing code patterned like this: __attribute__((__weak__, __visibility__("default"))) void* operator new(size_t size, const std::nothrow_t&) _NOEXCEPT { /*snip*/; return p; } to code like this: _LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) _NOEXCEPT { return p; } Howard: Thanks for all the comments regarding the default visibility tag on the definition. I agree it isn't needed, and that there are lots of other places where it is missing. That being said, I'm not wanting to rock the boat on that issue right now. So I've added it back to the definition via _LIBCPP_FUNC_VIS. A later pass dedicated just to this issue can bring things in to a consistent state one way or the other. Note that we do not want to have the exact same attributes on the declaration and defintion in this case. The declaration should not be marked weak, whereas the definition should (which is what G M's patch did). I've fully tested on OS X to ensure that the resultant attribute syntax actually works. llvm-svn: 192007
* G M: A small patch to fix a couple of warnings in stdexcept.cpp for cl.exe ↵Howard Hinnant2013-10-041-0/+4
| | | | | | which does not support #pragma visibility. llvm-svn: 191988
* G M: Provides the _LIBCPP_WARNING macro, to be used for MSVC only, since ↵Howard Hinnant2013-10-042-23/+57
| | | | | | that compiler doesn't support #warning. llvm-svn: 191980
* Re-add bad_cast and bad_typeid default ctor definitions under libsupc++.Peter Collingbourne2013-10-031-6/+9
| | | | | | | libsupc++ declares these constructors inline, so we won't necessarily get a definition for them in the library. llvm-svn: 191931
* Make the guard for external ABI libraries include the guard forChandler Carruth2013-09-251-2/+2
| | | | | | | | libsupc++ in typeinfo.cpp, bringing it into agreement with exception.cpp. This fixes link errors due to duplicate symbols from this translation unit. llvm-svn: 191397
* Peter Collingbourne: Fix warnings when compiling with -DNDEBUG.Howard Hinnant2013-09-211-0/+3
| | | | llvm-svn: 191148
* N3659: Shared locking in C++ Revision 2, c++1y onlyHoward Hinnant2013-09-211-0/+101
| | | | llvm-svn: 191127
* Fix typo.Joerg Sonnenberger2013-09-171-1/+1
| | | | llvm-svn: 190857
* G M: Restore the ability for libcxx to compile again on mingw 64.Howard Hinnant2013-09-171-8/+8
| | | | llvm-svn: 190837
* Marshall Clow: LWG Issue 2056: future_errc enums start with value 0 ↵Howard Hinnant2013-09-141-0/+6
| | | | | | (invalid value for broken_promise). llvm-svn: 190756
* Adding bad_array_length to libc++Marshall Clow2013-09-111-1/+17
| | | | llvm-svn: 190478
* Evgeniy Stepanov: Add noexcept to ~bad_optional_access() to silence warning ↵Howard Hinnant2013-09-041-2/+2
| | | | | | during build. llvm-svn: 189949
* Implement N3672, optional<T>.Howard Hinnant2013-09-021-0/+25
| | | | llvm-svn: 189772
* Xing Xue: Some minor changes for IBM XLC++/AIX.Howard Hinnant2013-08-291-0/+5
| | | | llvm-svn: 189623
* Turn off extern templates for most uses. It is causing more problems than ↵Howard Hinnant2013-08-295-0/+9
| | | | | | it is worth. The extern templates will still be built into the dylib, mainly for ABI stability purposes. And the client can still turn these back on with a #define if desire. This fixes http://llvm.org/bugs/show_bug.cgi?id=17027. However there's no associated test for the test suite because http://llvm.org/bugs/show_bug.cgi?id=17027 needs mismatched dylib and headers to fire. llvm-svn: 189610
* G M: Improvements to Windows support.Howard Hinnant2013-08-262-49/+45
| | | | llvm-svn: 189273
* Rename _LIBCPP_DEBUG2 to _LIBCPP_DEBUG.Howard Hinnant2013-08-231-1/+1
| | | | llvm-svn: 189140
* Debug mode for string. This commit also marks the first time libc++ ↵Howard Hinnant2013-08-231-41/+65
| | | | | | debug-mode has found a bug (found one in regex). Had to play with extern templates a bit to get this to work since string is heavily used within libc++.dylib. llvm-svn: 189114
* Glen: replace obsolete _LIBCPP_CANTTHROW with _NOEXCEPT.Howard Hinnant2013-08-221-5/+5
| | | | llvm-svn: 189046
* LWG 2145 - mark constructor for std::error_category as inline and constexpr. ↵Marshall Clow2013-08-211-0/+1
| | | | | | Leave the (existing, out-of-line, non-constexpr) in the dylib for compatibility with existing programs) llvm-svn: 188858
* Xing Xue: port to IBM XLC++/AIX.Howard Hinnant2013-08-142-2/+4
| | | | llvm-svn: 188396
* Fix signed/unsigned warnings when building libc++ in C++14 modeMarshall Clow2013-08-141-3/+3
| | | | llvm-svn: 188395
* 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
* Ok, 3 major changes for debug mode in one commit:Howard Hinnant2013-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. I had been detecting and trapping iterator == and \!= among iterators in different containers as an error. But the trapping itself is actually an error. Consider: #include <iostream> #include <vector> #include <algorithm> template <class C> void display(const C& c) { std::cout << "{"; bool first = true; for (const auto& x : c) { if (\!first) std::cout << ", "; first = false; std::cout << x; } std::cout << "}\n"; } int main() { typedef std::vector<int> V; V v1 = {1, 3, 5}; V v2 = {2, 4, 6}; display(v1); display(v2); V::iterator i = std::find(v1.begin(), v1.end(), 1); V::iterator j = std::find(v2.begin(), v2.end(), 2); if (*i == *j) i = j; // perfectly legal // ... if (i \!= j) // the only way to check v2.push_back(*i); display(v1); display(v2); } It is legal to assign an iterator from one container to another of the same type. This is required to work. One might want to test whether or not such an assignment had been made. The way one performs such a check is using the iterator's ==, \!= operator. This is a logical and necessary function and does not constitute an error. 2. I had a header circular dependence bug when _LIBCPP_DEBUG2 is defined. This caused a problem in several of the libc++ tests. Fixed. 3. There is a serious problem when _LIBCPP_DEBUG2=1 at the moment in that std::basic_string is inoperable. std::basic_string uses __wrap_iterator to implement its iterators. __wrap_iterator has been rigged up in debug mode to support vector. But string hasn't been rigged up yet. This means that one gets false positives when using std::string in debug mode. I've upped std::string's priority in www/debug_mode.html. llvm-svn: 187636
* Nico Rieck: Currently _MSC_VER and _WIN32 are used to guard code which isHoward Hinnant2013-08-012-25/+25
| | | | | | | | | | | | | | | | | | | | | | MSVC-specific, MSVCRT-specific, or Windows-specific. Because Clang can also define _MSC_VER, and MSVCRT is not necessarily the only C runtime, these macros should not be used interchangeably. This patch divides all Windows-related bits into the aforementioned categories. Two new macros are introduced: - _LIBCPP_MSVC: Defined when compiling with MSVC. Detected using _MSC_VER, excluding Clang. - _LIBCPP_MSVCRT: Defined when using the Microsoft CRT. This is the default when _WIN32 is defined. This leaves _WIN32 for code using the Windows API. This also corrects the spelling of _LIBCP_HAS_IS_BASE_OF to _LIBCPP_HAS_IS_BASE_OF. Nico, please prepare a patch for CREDITS.TXT, thanks. llvm-svn: 187593
* Glen: Minor tweaks to locale.cpp to help it compile with exceptions turned off.Howard Hinnant2013-07-281-2/+3
| | | | llvm-svn: 187332
* Add some friendly messages to libcxx calls to abort().Howard Hinnant2013-07-233-0/+13
| | | | llvm-svn: 186951
* War on tabs.Howard Hinnant2013-07-081-3/+3
| | | | llvm-svn: 185865
* Windows port for __codecvt_utf8<wchar_t>.Howard Hinnant2013-07-081-0/+19
| | | | llvm-svn: 185849
* Don't free the C locale on NetBSD.Joerg Sonnenberger2013-07-021-1/+1
| | | | llvm-svn: 185467
* Windows support in thread::hardware_concurrency.Howard Hinnant2013-07-021-0/+7
| | | | llvm-svn: 185451
* Matthew Dempsky: POSIX defines that the _POSIX_C_SOURCE macros are to be set ↵Howard Hinnant2013-06-301-3/+3
| | | | | | | | | | | | | | | | | | | | by user code to specify what version of POSIX the system should provide. If you want to check what version of POSIX is actually available, you're supposed to test _POSIX_VERSION. However, since sysconf() has been in POSIX since 1995, it's probably safe to assume it's available on any system with a C++11 compiler, especially if _SC_NPROCESSORS_ONLN is defined too. So no point in a complicated preprocessor rule if just we unconditionally include <unistd.h> (on non-Windows systems). Also, I've added a #warning for to help porters detect when a suitable implementation isn't detected at compile-time. Howard: Matthew, can you patch CREDITS.TXT? Thanks. llvm-svn: 185275
* Matthew Dempsky: Same as stdexcept.cpp in libc++abi: we've already computed ↵Howard Hinnant2013-06-291-1/+1
| | | | | | 'len strlen(msg)', so we can use memcpy() instead of strcpy(). llvm-svn: 185274
* Add NetBSD support.Joerg Sonnenberger2013-05-171-9/+30
| | | | llvm-svn: 182162
* Create a weak pthread_create reference on NetBSD to not force aJoerg Sonnenberger2013-05-171-0/+4
| | | | | | dependency on libpthread for code that doesn't use threads itself. llvm-svn: 182161
* Glen: This patch gets the string conversion functions working on Windows. ↵Howard Hinnant2013-05-163-511/+367
| | | | | | It also refactors repetitive code in string.cpp do greatly reduce the repetitiveness, increasing maintainability. llvm-svn: 182026
* Don't try to free the C locale.Joerg Sonnenberger2013-05-091-1/+1
| | | | llvm-svn: 181559
* Initialize codecvt explicitly with the C locale, which might not be 0.Joerg Sonnenberger2013-05-091-1/+1
| | | | llvm-svn: 181534
* The push/pop variant of pragma GCC diagnostic is only supported by ClangJoerg Sonnenberger2013-05-021-0/+4
| | | | | | and GCC 4.6 and newer, so protect accordingly. llvm-svn: 180943
* Add explicit casts to unsigned char before calling ctype functions.Joerg Sonnenberger2013-05-021-4/+4
| | | | | | Fixes the value range on platforms with signed char. llvm-svn: 180940
* Use static_cast.Joerg Sonnenberger2013-04-271-5/+8
| | | | llvm-svn: 180680
* Use reinterpret_casts directly in place of C-style casts.Joerg Sonnenberger2013-04-271-4/+4
| | | | llvm-svn: 180679
* Only use Clang pragma when compiling with clang.Joerg Sonnenberger2013-04-271-0/+2
| | | | llvm-svn: 180678
* Fix typos.Joerg Sonnenberger2013-04-261-2/+2
| | | | llvm-svn: 180598
* Fix bug in __libcpp_db::__iterator_copy. Add debug test for swaping lists.Howard Hinnant2013-04-051-3/+2
| | | | llvm-svn: 178892
* Reference: ↵Howard Hinnant2013-04-021-26/+99
| | | | | | http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130325/077133.html llvm-svn: 178581
* Reference: ↵Howard Hinnant2013-04-021-0/+2
| | | | | | http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130325/077132.html llvm-svn: 178545
OpenPOWER on IntegriCloud