`cl` objects to the initialization of the templated type differing in storage
class due to the indication of `constexpr`. `constexpr` does not give the value
itself a `const` storage class. However, because the value is not initialized
inline, it does not like the `constexpr` attribute. Apply the `constexpr` only
on clang, and correct the storage to `const`.
- Added missing ifdef guard in PointerIntEnum header
- Consistent naming convention for ifdef guards
- Consistent 'end namespace swift'
- Consistent single EOL at end of header files
Previously due to the way that ARC works, it was impossible to trigger any
memory safety issues. That being said the fact that the memory safety here is
non-obvious suggests that the right thing to do is just bite the bullet and
clear the ImmutablePointerSetFactory.
We do this by doing a traversal of our sorted lists in a similar manner as one
would when one is merging two such sets, i.e. one has two iterators and always
advances the iterator that has a value that is less than the other. If we ever
hit a situation where the two iterators equal, we must have a non-empty
intersection.
A unittest that exercises very basic functionality is provided as well.
Specifically:
1. set_union_for_each. This is like std::for_each, but it visits its inputs
(which are assumed to be sorted/uniqued sets) in set_union order.
2. is_uniqued_and_sorted.
I also fixed several nits from Jordan.
This is an immutable data structure with the following properties:
1. All of the sets are sorted and can be iterated over.
2. It takes in a bump ptr allocator and uses that allocator for all
allocations.
3. All concatenation operations involve only one bump ptr allocation.
4. Since we are only storing pointers, the data structure does not need any
destructors to be invoked to be cleaned up. The bumpptrallocator memory just
needs to be freed.
I am going to use this to improve the compile time performance of ARC.