10 Commits

Author SHA1 Message Date
Chandler Carruth
6b547686c5 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +00:00
Florian Hahn
c8be3e89c6 [ADT] Remove illegal comparison of singular iterators from SmallSetTest
This removes the assertion that a copy of a moved-from SmallSetIterator
equals the original, which is illegal due to SmallSetIterator including
an instance of a standard `std::set` iterator.

C++ [iterator.requirements.general] states that comparing singular
iterators has undefined result:

> Iterators can also have singular values that are not associated with
> any sequence. [...] Results of most expressions are undefined for
> singular values; the only exceptions are destroying an iterator that
> holds a singular value, the assignment of a non-singular value to an
> iterator that holds a singular value, and, for iterators that satisfy
> the Cpp17DefaultConstructible requirements, using a value-initialized
> iterator as the source of a copy or move operation.

This assertion triggers the following error in the GNU C++ Library in
debug mode under EXPENSIVE_CHECKS:

  /usr/include/c++/8.2.1/debug/safe_iterator.h:518:
  Error: attempt to compare a singular iterator to a singular iterator.

  Objects involved in the operation:
      iterator "lhs" @ 0x0x7fff86420670 {
        state = singular;
      }
      iterator "rhs" @ 0x0x7fff86420640 {
        state = singular;
      }

Patch by Eugene Sharygin.

Reviewers: fhahn, dblaikie, chandlerc

Reviewed By: fhahn, dblaikie

Differential Revision: https://reviews.llvm.org/D53793


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345712 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-31 11:00:48 +00:00
Florian Hahn
f2cead440d Recommit r334887: [SmallSet] Add SmallSetIterator.
Updated to make sure we properly construct/destroy SetIter if it has a
non-trivial ctors/dtors, like in MSVC.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337818 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-24 10:32:54 +00:00
Florian Hahn
a5ec686ea5 Revert rL337292 due to another MSVC STL problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337303 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-17 17:12:50 +00:00
Florian Hahn
a5d6389938 Recommit r334887: [SmallSet] Add SmallSetIterator.
Spell out destructor, copy/move constructor and assignment operators for
MSVC STL, where set<T>::const_iterator is not trivially copy constructible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337292 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-17 15:24:19 +00:00
Galina Kistanova
0f2affe94b Reverted r336805 as it broke llvm-clang-x86_64-expensive-checks-win build bot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336923 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-12 17:58:10 +00:00
Florian Hahn
abad63db77 Recommit r334887: [SmallSet] Add SmallSetIterator.
This version now uses the subset of is_trivially_XXX provided by
GCC 4.8 and llvm/Support/type_traits.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336805 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-11 13:39:59 +00:00
Florian Hahn
6b5cc84779 Revert r334887, as GCC 4.8 does not have is_trivially_copy_constructible & co
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334889 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-16 13:00:33 +00:00
Florian Hahn
348096519e [SmallSet] Add SmallSetIterator.
This patch adds a simple const_iterator implementation for SmallSet by
delegating to either a SmallVector::const_iterator or
std::set::const_iterator, depending on which storage is used by the
SmallSet.

Reviewers: dblaikie, craig.topper

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D47942


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334887 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-16 12:36:19 +00:00
Florian Hahn
c2adc2d429 [SmallSet] Add some simple unit tests.
Reviewers: craig.topper, dblaikie

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D47940


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334321 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-08 21:14:49 +00:00