summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
...
* Compilation test for PostOrderIterator.Michael Ilseman2014-11-201-0/+1
| | | | | | | | | If the template specialization for externally managed sets in PostOrderIterator call too far out of sync with each other, this unit test will fail to build. This is especially useful for developers who may not build Clang (the only in-tree user) every time. llvm-svn: 222447
* Ensure function_refs are copyable even from non-const referencesDavid Blaikie2014-11-121-0/+1
| | | | | | | | | | | | | | | | | | A subtle bug was found where attempting to copy a non-const function_ref lvalue would actually invoke the generic forwarding constructor (as it was a closer match - being T& rather than the const T& of the implicit copy constructor). In the particular case this lead to a dangling function_ref member (since it had referenced the function_ref passed by value to its ctor, rather than the outer function_ref that was still alive) SFINAE the converting constructor to not be considered if the copy constructor is available and demonstrate that this causes the copy to refer to the original functor, not to the function_ref it was copied from. (without the code change, the test would fail as Y would be referencing X and Y() would see the result of the mutation to X, ie: 2) llvm-svn: 221753
* Remove OwningPtr.h and associated testsAlp Toker2014-06-191-1/+0
| | | | | | llvm::OwningPtr is superseded by std::unique_ptr. llvm-svn: 211259
* [C++11] Now that we have C++11 and I've replaced the use of thisChandler Carruth2014-03-091-1/+0
| | | | | | | horrible smart pointer by std::unique_ptr and strict move semantics, rip this out. llvm-svn: 203392
* [C++11] Add llvm::make_unique, according to N3656.Ahmed Charles2014-03-091-0/+1
| | | | llvm-svn: 203387
* [ADT] Update PointerIntPair to handle pointer types with more than 31 bits free.Jordan Rose2014-03-071-0/+1
| | | | | | | | | | Previously, the assertions in PointerIntPair would try to calculate the value (1 << NumLowBitsAvailable); the inferred type here is 'int', so if there were more than 31 bits available we'd get a shift overflow. Also, add a rudimentary unit test file for PointerIntPair. llvm-svn: 203273
* Cleaning up a bunch of pre-Visual C++ 2012 build hacks.Yaron Keren2014-03-041-9/+0
| | | | llvm-svn: 202806
* Give APInt move semantics.Benjamin Kramer2014-03-021-0/+1
| | | | | | | The interaction between defaulted operators and move elision isn't totally obvious, add a unit test so it doesn't break unintentionally. llvm-svn: 202662
* [C++11] Add unit tests for OwningPtr<T> in preparation for changes to makeChandler Carruth2014-03-021-0/+1
| | | | | | | | | | it interoperate (minimally) with std::unique_ptr<T>. This is part of my plan to migrate LLVM to use std::unique_ptr with a minimal impact on out-of-tree code. Patch by Ahmed Charles with some minor cleanups (and bool casts) by me. llvm-svn: 202608
* Fix layering StringRef copy using BumpPtrAllocator.Nick Kledzik2014-02-051-0/+1
| | | | | | | | | Now to copy a string into a BumpPtrAllocator and get a StringRef to the copy: StringRef myCopy = myStr.copy(myAllocator); llvm-svn: 200885
* Add a polymorphic_ptr<T> smart pointer data type. It's a somewhat sillyChandler Carruth2013-11-091-0/+1
| | | | | | | | | | | | unique ownership smart pointer which is *deep* copyable by assuming it can call a T::clone() method to allocate a copy of the owned data. This is mostly useful with containers or other collections of uniquely owned data in C++98 where they *might* copy. With C++11 we can likely remove this in favor of move-only types and containers wrapped around those types. llvm-svn: 194315
* Basic unit tests for PointerUnionDavid Blaikie2013-08-211-0/+1
| | | | llvm-svn: 188933
* Allow llvm::Optional to work with types without default constructors.David Blaikie2013-02-201-0/+1
| | | | | | | | | This generalizes Optional to require less from the T type by using aligned storage for backing & placement new/deleting the T into it when necessary. Also includes unit tests. llvm-svn: 175580
* Add file to CMakeLists (file added in r173505)Dmitri Gribenko2013-01-251-0/+1
| | | | llvm-svn: 173513
* Introduce a new data structure, the SparseMultiSet, and changes to the MI ↵Michael Ilseman2013-01-211-0/+1
| | | | | | | | scheduler to use it. A SparseMultiSet adds multiset behavior to SparseSet, while retaining SparseSet's desirable properties. Essentially, SparseMultiSet provides multiset behavior by storing its dense data in doubly linked lists that are inlined into the dense vector. This allows it to provide good data locality as well as vector-like constant-time clear() and fast constant time find(), insert(), and erase(). It also allows SparseMultiSet to have a builtin recycler rather than keeping SparseSet's behavior of always swapping upon removal, which allows it to preserve more iterators. It's often a better alternative to a SparseSet of a growable container or vector-of-vector. llvm-svn: 173064
* Update CMake build.Benjamin Kramer2012-10-141-0/+1
| | | | llvm-svn: 165908
* ADTTests: [CMake] Exclude DenseMapTest.cpp and SmallVectorTest.cpp on MSVC9 ↵NAKAMURA Takumi2012-08-301-1/+14
| | | | | | due to its bug. llvm-svn: 162918
* Bring TinyPtrVector under test. Somehow we never picked up unit testsChandler Carruth2012-07-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | for this class. These tests exercise most of the basic properties, but the API for TinyPtrVector is very strange currently. My plan is to start fleshing out the API to match that of SmallVector, but I wanted a test for what is there first. Sadly, it doesn't look reasonable to just re-use the SmallVector tests, as this container can only ever store pointers, and much of the SmallVector testing is to get construction and destruction right. Just to get this basic test working, I had to add value_type to the interface. While here I found a subtle bug in the combination of 'erase', 'begin', and 'end'. Both 'begin' and 'end' wanted to use a null pointer to indicate the "end" iterator of an empty vector, regardless of whether there is actually a vector allocated or the pointer union is null. Everything else was fine with this except for erase. If you erase the last element of a vector after it has held more than one element, we return the end iterator of the underlying SmallVector which need not be a null pointer. Instead, simply use the pointer, and poniter + size() begin/end definitions in the tiny case, and delegate to the inner vector whenever it is present. llvm-svn: 161024
* Completely refactor the structuring of unittest CMake files to match theChandler Carruth2012-06-211-0/+32
Makefiles, the CMake files in every other part of the LLVM tree, and sanity. This should also restore the output tree structure of all the unit tests, sorry for breaking that, and thanks for letting me know. The fundamental change is to put a CMakeLists.txt file in the unittest directory, with a single test binary produced from it. This has several advantages: - No more weird directory stripping in the unittest macro, allowing it to be used more readily in other projects. - No more directory prefixes on all the source files. - Allows correct and precise use of LLVM's per-directory dependency system. - Allows use of the checking logic for source files that have not been added to the CMake build. This uncovered a file being skipped with CMake in LLVM and one in Clang's unit tests. - Makes Specifying conditional compilation or other custom logic for JIT tests easier. It did require adding the concept of an explicit 'optional' source file to the CMake build so that the missing-file check can skip cases where the file is *supposed* to be missing. =] This is another chunk of refactoring the CMake build in order to make it usable for other clients like CompilerRT / ASan / TSan. Note that this is interdependent with a Clang CMake change. llvm-svn: 158909
OpenPOWER on IntegriCloud