summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAge
* Reverting r211950 -- it did not help resolve the -Wcomment warnings ↵Aaron Ballman2014-06-27
| | | | | | triggered in GCC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211953 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding some trailing whitespace after a comment previously ending with \ to ↵Aaron Ballman2014-06-27
| | | | | | ensure that it isn't lexed as a multiline comment. This silences some -Wcomment warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211950 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r211287: Remove support for LLVM runtime multi-threading.Chandler Carruth2014-06-27
| | | | | | | I'll fix the problems in libclang and other projects in ways that don't require <mutex> until we sort out the cygwin situation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211900 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Introduce a string_ostream string builder facilty"Alp Toker2014-06-26
| | | | | | Temporarily back out commits r211749, r211752 and r211754. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211814 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a string_ostream string builder faciltyAlp Toker2014-06-26
| | | | | | | | | | | | | | | | | | | | string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211749 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r211287, "Remove support for LLVM runtime multi-threading."NAKAMURA Takumi2014-06-24
| | | | | | libclang still requires it on cygming, lack of incomplete <mutex>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211592 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Return ScaledNumbers::MaxScale from getQuotient()Duncan P. N. Exon Smith2014-06-24
| | | | | | Return MaxScale now that it's available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211559 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Extract ScaledNumbers::getSum() and getDifference()Duncan P. N. Exon Smith2014-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211553 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Return scale from ScaledNumbers::matchScales()Duncan P. N. Exon Smith2014-06-23
| | | | | | This will be convenient when extracting `ScaledNumbers::getSum()`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211552 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Extract ScaledNumbers::matchScale()Duncan P. N. Exon Smith2014-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211531 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit 211309 (StringMap::insert), reverted in 211328 due to issues with ↵David Blaikie2014-06-23
| | | | | | | | | | | | private, but non-deleted, move members. Certain versions of GCC (~4.7) couldn't handle the SFINAE on access control, but with "= delete" (hidden behind a macro for portability) this issue is worked around/addressed. Patch by Agustín Bergé git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211525 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup r211507Duncan P. N. Exon Smith2014-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211521 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Extract ScaledNumbers::compare()Duncan P. N. Exon Smith2014-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211507 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: ScaledNumber: Fix inconsistent test namesDuncan P. N. Exon Smith2014-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211414 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Write ScaledNumbers::getLg{,Floor,Ceiling}()Duncan P. N. Exon Smith2014-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211413 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Write ScaledNumber::getQuotient() and getProduct()Duncan P. N. Exon Smith2014-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211409 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Mark end of namespacesDuncan P. N. Exon Smith2014-06-20
| | | | | | This convinces clang-format to leave a newline. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211406 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Replace Execution Engine's mutex with std::recursive_mutex."Zachary Turner2014-06-20
| | | | | | | | | | This reverts commit 1f502bd9d7d2c1f98ad93a09ffe435e11a95aedd, due to GCC / MinGW's lack of support for C++11 threading. It's possible this will go back in after we come up with a reasonable solution. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211401 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some -Wsign-compare fallout from changing container count member ↵David Blaikie2014-06-20
| | | | | | functions to return unsigned instead of bool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211393 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Clean up getRounded() testsDuncan P. N. Exon Smith2014-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211337 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Write ScaledNumbers::getAdjusted()Duncan P. N. Exon Smith2014-06-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211336 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Write ScaledNumbers::getRounded()Duncan P. N. Exon Smith2014-06-20
| | | | | | | | | | | Start extracting helper functions out of -block-freq's `UnsignedFloat` into `Support/ScaledNumber.h` with the eventual goal of moving and renaming the class to `ScaledNumber`. The bike shed about names is still being painted, but I'm going with this for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211333 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Add StringMap::insert(pair) consistent with the standard associative ↵Rafael Espindola2014-06-20
| | | | | | | | | | | | container concept." This reverts commit r211309. It looks like it broke some bots: http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/15563/steps/compile/logs/stdio git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211328 91177308-0d34-0410-b5e6-96231b3b80d8
* Add StringMap::insert(pair) consistent with the standard associative ↵David Blaikie2014-06-19
| | | | | | | | container concept. Patch by Agustín Bergé. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211309 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove support for LLVM runtime multi-threading.Zachary Turner2014-06-19
| | | | | | | | | | | | | After a number of previous small iterations, the functions llvm_start_multithreaded() and llvm_stop_multithreaded() have been reduced essentially to no-ops. This change removes them entirely. Reviewed by: rnk, dblaikie Differential Revision: http://reviews.llvm.org/D4216 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211287 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove OwningPtr.h and associated testsAlp Toker2014-06-19
| | | | | | llvm::OwningPtr is superseded by std::unique_ptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211259 91177308-0d34-0410-b5e6-96231b3b80d8
* PR10140 - StringPool's PooledStringPtr has non-const operator== causing bad ↵Nikola Smiljanic2014-06-19
| | | | | | | | OR-result. Mark conversion operator explicit and const qualify comparison operators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211244 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace Execution Engine's mutex with std::recursive_mutex.Zachary Turner2014-06-18
| | | | | | | | | | | | | This change has a bit of a trickle down effect due to the fact that there are a number of derived implementations of ExecutionEngine, and that the mutex is not tightly encapsulated so is used by other classes directly. Reviewed by: rnk Differential Revision: http://reviews.llvm.org/D4196 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211214 91177308-0d34-0410-b5e6-96231b3b80d8
* ConvertUTF tests: remove uses of initializer lists to restore compatibilityDmitri Gribenko2014-06-17
| | | | | | | with MSVC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211093 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix build breakage caused by change to ValueMapTest.Zachary Turner2014-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211083 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose ValueMap's mutex type as a typedef instead of a sys::Mutex.Zachary Turner2014-06-17
| | | | | | | | This enables static polymorphism of the mutex type, which is necessary in order to replace the standard mutex implementation with a different type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211080 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r211066, 211067, 211068, 211069, 211070.Zachary Turner2014-06-16
| | | | | | | These were committed accidentally from the wrong branch before having a review sign-off. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211072 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some more code out into a separate CL.Zachary Turner2014-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211067 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/ConvertUTF: implement U+FFFD insertion according to the recommendationDmitri Gribenko2014-06-16
| | | | | | | | | | given in the Unicode spec That is, replace every maximal subpart of an ill-formed subsequence with one U+FFFD. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211015 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding llvm::sys::swapByteOrder() for the common use-case of byte-swapping a ↵Artyom Skrobov2014-06-14
| | | | | | value in place git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210976 91177308-0d34-0410-b5e6-96231b3b80d8
* Renaming SwapByteOrder() to getSwappedBytes()Artyom Skrobov2014-06-14
| | | | | | | | The next commit will add swapByteOrder(), acting in-place git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210973 91177308-0d34-0410-b5e6-96231b3b80d8
* Finishing touch for the std::error_code transition.Rafael Espindola2014-06-13
| | | | | | | | | | | While std::error_code itself seems to work OK in all platforms, there are few annoying differences with regards to the std::errc enumeration. This patch adds a simple llvm enumeration, which will hopefully avoid build breakages in other platforms and surprises as we get more uses of std::error_code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210920 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the last uses of 'using std::error_code'Rafael Espindola2014-06-13
| | | | | | This finishes the transition to std::error_code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210877 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-12
| | | | | | This should make sure that most new uses use the std prefix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210835 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210783 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused has_magic.Rafael Espindola2014-06-11
| | | | | | | This will allow inlining get_magic, which should in turn fix one of the mingw build problems after the switch to std::error_code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210712 91177308-0d34-0410-b5e6-96231b3b80d8
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of this patch is to turn llvm/Support/system_error.h into a transitional header that just brings in the erorr_code api to the llvm namespace. I will remove it shortly afterwards. The cases where the general idea needed some tweaking: * std::errc is a namespace in msvc, so we cannot use "using std::errc". I could add an #ifdef, but there were not that many uses, so I just added std:: to them in this patch. * Template specialization had to be moved to the std namespace in this patch set already. * The msvc implementation of default_error_condition doesn't seem to provide the same transformations as we need. Not too surprising since the standard doesn't actually say what "equivalent" means. I fixed the problem by keeping our old mapping and using it at error_code construction time. Despite these shortcomings I think this is still a good thing. Some reasons: * The different implementations of system_error might improve over time. * It removes 925 lines of code from llvm already. * It removes 6313 bytes from the text segment of the clang binary when it is built with gcc and 2816 bytes when building with clang and libstdc++. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210687 91177308-0d34-0410-b5e6-96231b3b80d8
* SmallVectorTest: Make the deleted member functions private to help MSVC users.David Blaikie2014-06-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210665 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert StringMapEntry::Create to use StringRef instead of start/end ↵Craig Topper2014-06-11
| | | | | | pointers. Simpliies all in tree call sites. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210638 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove windows_error.Rafael Espindola2014-06-11
| | | | | | | | | | MSVC doesn't seem to provide any is_error_code_enum enumeration for the windows errors. Fortunately very few places in llvm have to handle raw windows errors, so we can just construct the corresponding error_code directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210631 91177308-0d34-0410-b5e6-96231b3b80d8
* SmallVectorTest.cpp: Use LLVM_DELETED_FUNCTION.NAKAMURA Takumi2014-06-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210507 91177308-0d34-0410-b5e6-96231b3b80d8
* SmallVector: support resize(N) with move-only typesDavid Blaikie2014-06-09
| | | | | | | | | | | | | | | Unfortunately there's no way to elegantly do this with pre-canned algorithms. Using a generating iterator doesn't work because you default construct for each element, then move construct into the actual slot (bad for copy but non-movable types, and a little unneeded overhead even in the move-only case), so just write it out manually. This solution isn't exception safe (if one of the element's ctors calls we don't fall back, destroy the constructed elements, and throw on - which std::uninitialized_fill does do) but SmallVector (and LLVM) isn't exception safe anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210495 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'.Craig Topper2014-06-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210442 91177308-0d34-0410-b5e6-96231b3b80d8
* SmallVector: Improve test coverage for insert with repetitionDavid Blaikie2014-06-08
| | | | | | | | | | | | | To test cases that involve actual repetition (> 1 elements), at least one element before the insertion point, and some elements of the original range that still fit in that range space after insertion. Actually we need coverage for the inverse case too (where no elements after the insertion point fit into the previously allocated space), but this'll do for now, and I might end up rewriting bits of SmallVector to avoid that special case anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210436 91177308-0d34-0410-b5e6-96231b3b80d8
* SmallVector: More movable improvements - don't copy elements to make space ↵David Blaikie2014-06-08
| | | | | | | | when inserting repeated elements. Also split and improve tests a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210433 91177308-0d34-0410-b5e6-96231b3b80d8