Date: Thu, 18 May 2017 18:33:34 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r318477 - in projects/clang500-import: contrib/compiler-rt/lib/builtins contrib/libc++/include contrib/llvm/include/llvm/ADT contrib/llvm/include/llvm/Analysis contrib/llvm/include/llvm... Message-ID: <201705181833.v4IIXYTr066932@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Thu May 18 18:33:33 2017 New Revision: 318477 URL: https://svnweb.freebsd.org/changeset/base/318477 Log: Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303291, and update build glue. Modified: projects/clang500-import/contrib/compiler-rt/lib/builtins/floatdidf.c projects/clang500-import/contrib/libc++/include/iterator projects/clang500-import/contrib/libc++/include/optional projects/clang500-import/contrib/llvm/include/llvm/ADT/APInt.h projects/clang500-import/contrib/llvm/include/llvm/ADT/BitVector.h projects/clang500-import/contrib/llvm/include/llvm/ADT/PostOrderIterator.h projects/clang500-import/contrib/llvm/include/llvm/ADT/PriorityWorklist.h projects/clang500-import/contrib/llvm/include/llvm/ADT/SCCIterator.h projects/clang500-import/contrib/llvm/include/llvm/ADT/Sequence.h projects/clang500-import/contrib/llvm/include/llvm/ADT/SetVector.h projects/clang500-import/contrib/llvm/include/llvm/ADT/SmallBitVector.h projects/clang500-import/contrib/llvm/include/llvm/ADT/SmallPtrSet.h projects/clang500-import/contrib/llvm/include/llvm/ADT/SmallVector.h projects/clang500-import/contrib/llvm/include/llvm/ADT/SparseBitVector.h projects/clang500-import/contrib/llvm/include/llvm/ADT/SparseMultiSet.h projects/clang500-import/contrib/llvm/include/llvm/ADT/SparseSet.h projects/clang500-import/contrib/llvm/include/llvm/ADT/StringExtras.h projects/clang500-import/contrib/llvm/include/llvm/ADT/StringMap.h projects/clang500-import/contrib/llvm/include/llvm/ADT/StringRef.h projects/clang500-import/contrib/llvm/include/llvm/ADT/StringSet.h projects/clang500-import/contrib/llvm/include/llvm/ADT/TinyPtrVector.h projects/clang500-import/contrib/llvm/include/llvm/ADT/UniqueVector.h projects/clang500-import/contrib/llvm/include/llvm/Analysis/ProfileSummaryInfo.h projects/clang500-import/contrib/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h projects/clang500-import/contrib/llvm/include/llvm/DebugInfo/CodeView/RandomAccessTypeVisitor.h projects/clang500-import/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFAttribute.h projects/clang500-import/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h projects/clang500-import/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h projects/clang500-import/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h projects/clang500-import/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h projects/clang500-import/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h projects/clang500-import/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h projects/clang500-import/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h projects/clang500-import/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h projects/clang500-import/contrib/llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h projects/clang500-import/contrib/llvm/include/llvm/IR/IntrinsicsPowerPC.td projects/clang500-import/contrib/llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td projects/clang500-import/contrib/llvm/lib/Analysis/DependenceAnalysis.cpp projects/clang500-import/contrib/llvm/lib/Analysis/InlineCost.cpp projects/clang500-import/contrib/llvm/lib/Analysis/InstructionSimplify.cpp projects/clang500-import/contrib/llvm/lib/Analysis/ProfileSummaryInfo.cpp projects/clang500-import/contrib/llvm/lib/Analysis/ScalarEvolution.cpp projects/clang500-import/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp projects/clang500-import/contrib/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp projects/clang500-import/contrib/llvm/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp projects/clang500-import/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp projects/clang500-import/contrib/llvm/lib/CodeGen/MachineVerifier.cpp projects/clang500-import/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp projects/clang500-import/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp projects/clang500-import/contrib/llvm/lib/CodeGen/SpillPlacement.cpp projects/clang500-import/contrib/llvm/lib/CodeGen/StackColoring.cpp projects/clang500-import/contrib/llvm/lib/CodeGen/TargetLoweringBase.cpp projects/clang500-import/contrib/llvm/lib/CodeGen/TargetPassConfig.cpp projects/clang500-import/contrib/llvm/lib/CodeGen/TargetRegisterInfo.cpp projects/clang500-import/contrib/llvm/lib/DebugInfo/CodeView/CVTypeDumper.cpp projects/clang500-import/contrib/llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp projects/clang500-import/contrib/llvm/lib/DebugInfo/CodeView/RandomAccessTypeVisitor.cpp projects/clang500-import/contrib/llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp projects/clang500-import/contrib/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp projects/clang500-import/contrib/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp projects/clang500-import/contrib/llvm/lib/DebugInfo/PDB/Native/PDBTypeServerHandler.cpp projects/clang500-import/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp projects/clang500-import/contrib/llvm/lib/Support/CrashRecoveryContext.cpp projects/clang500-import/contrib/llvm/lib/Support/Unix/Path.inc projects/clang500-import/contrib/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp projects/clang500-import/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp projects/clang500-import/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.h projects/clang500-import/contrib/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp projects/clang500-import/contrib/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h projects/clang500-import/contrib/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp projects/clang500-import/contrib/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h projects/clang500-import/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp projects/clang500-import/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp projects/clang500-import/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp projects/clang500-import/contrib/llvm/lib/Target/AMDGPU/VOP3Instructions.td projects/clang500-import/contrib/llvm/lib/Target/ARM/ARMInstructionSelector.cpp projects/clang500-import/contrib/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp projects/clang500-import/contrib/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp projects/clang500-import/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp projects/clang500-import/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp projects/clang500-import/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h projects/clang500-import/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td projects/clang500-import/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp projects/clang500-import/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td projects/clang500-import/contrib/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp projects/clang500-import/contrib/llvm/lib/Target/WebAssembly/WebAssemblyRegColoring.cpp projects/clang500-import/contrib/llvm/lib/Target/WebAssembly/known_gcc_test_failures.txt projects/clang500-import/contrib/llvm/lib/Target/X86/X86.td projects/clang500-import/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp projects/clang500-import/contrib/llvm/lib/Target/X86/X86InstructionSelector.cpp projects/clang500-import/contrib/llvm/lib/Target/X86/X86LegalizerInfo.cpp projects/clang500-import/contrib/llvm/lib/Target/X86/X86Subtarget.h projects/clang500-import/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp projects/clang500-import/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.cpp projects/clang500-import/contrib/llvm/lib/Transforms/Coroutines/CoroFrame.cpp projects/clang500-import/contrib/llvm/lib/Transforms/InstCombine/InstCombineInternal.h projects/clang500-import/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp projects/clang500-import/contrib/llvm/lib/Transforms/Scalar/LICM.cpp projects/clang500-import/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp projects/clang500-import/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp projects/clang500-import/contrib/llvm/lib/Transforms/Scalar/NewGVN.cpp projects/clang500-import/contrib/llvm/lib/Transforms/Scalar/Reassociate.cpp projects/clang500-import/contrib/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp projects/clang500-import/contrib/llvm/tools/clang/include/clang/AST/Decl.h projects/clang500-import/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h projects/clang500-import/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h projects/clang500-import/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h projects/clang500-import/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h projects/clang500-import/contrib/llvm/tools/clang/include/clang/Sema/Sema.h projects/clang500-import/contrib/llvm/tools/clang/lib/AST/ASTDumper.cpp projects/clang500-import/contrib/llvm/tools/clang/lib/AST/Decl.cpp projects/clang500-import/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp projects/clang500-import/contrib/llvm/tools/clang/lib/AST/ODRHash.cpp projects/clang500-import/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp projects/clang500-import/contrib/llvm/tools/clang/lib/Driver/ToolChains/MSVC.cpp projects/clang500-import/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp projects/clang500-import/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h projects/clang500-import/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp projects/clang500-import/contrib/llvm/tools/clang/lib/Sema/Sema.cpp projects/clang500-import/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp projects/clang500-import/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp projects/clang500-import/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp projects/clang500-import/contrib/llvm/tools/lld/ELF/Relocations.cpp projects/clang500-import/contrib/llvm/tools/lld/ELF/Relocations.h projects/clang500-import/contrib/llvm/tools/lld/ELF/Thunks.cpp projects/clang500-import/contrib/llvm/tools/lld/ELF/Thunks.h projects/clang500-import/contrib/llvm/tools/lld/ELF/Writer.cpp projects/clang500-import/contrib/llvm/tools/lldb/include/lldb/Symbol/SymbolContext.h projects/clang500-import/contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp projects/clang500-import/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp projects/clang500-import/contrib/llvm/tools/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h projects/clang500-import/contrib/llvm/tools/lldb/source/Symbol/SymbolContext.cpp projects/clang500-import/contrib/llvm/tools/llvm-pdbdump/Analyze.cpp projects/clang500-import/contrib/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp projects/clang500-import/contrib/llvm/tools/llvm-pdbdump/PdbYaml.cpp projects/clang500-import/contrib/llvm/tools/llvm-pdbdump/YamlTypeDumper.cpp projects/clang500-import/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp projects/clang500-import/contrib/llvm/utils/TableGen/GlobalISelEmitter.cpp projects/clang500-import/lib/clang/include/clang/Basic/Version.inc projects/clang500-import/lib/clang/include/lld/Config/Version.inc projects/clang500-import/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: projects/clang500-import/contrib/compiler-rt/ (props changed) projects/clang500-import/contrib/libc++/ (props changed) projects/clang500-import/contrib/llvm/ (props changed) projects/clang500-import/contrib/llvm/tools/clang/ (props changed) projects/clang500-import/contrib/llvm/tools/lld/ (props changed) projects/clang500-import/contrib/llvm/tools/lldb/ (props changed) Modified: projects/clang500-import/contrib/compiler-rt/lib/builtins/floatdidf.c ============================================================================== --- projects/clang500-import/contrib/compiler-rt/lib/builtins/floatdidf.c Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/compiler-rt/lib/builtins/floatdidf.c Thu May 18 18:33:33 2017 (r318477) @@ -104,7 +104,7 @@ __floatdidf(di_int a) } #endif -#if defined(__AEABI__) +#if defined(__ARM_EABI__) AEABI_RTABI double __aeabi_l2d(di_int a) { return __floatdidf(a); } Modified: projects/clang500-import/contrib/libc++/include/iterator ============================================================================== --- projects/clang500-import/contrib/libc++/include/iterator Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/libc++/include/iterator Thu May 18 18:33:33 2017 (r318477) @@ -64,14 +64,23 @@ struct forward_iterator_tag : publ struct bidirectional_iterator_tag : public forward_iterator_tag {}; struct random_access_iterator_tag : public bidirectional_iterator_tag {}; +// 27.4.3, iterator operations // extension: second argument not conforming to C++03 -template <class InputIterator> -void advance(InputIterator& i, +template <class InputIterator> // constexpr in C++17 + constexpr void advance(InputIterator& i, typename iterator_traits<InputIterator>::difference_type n); -template <class InputIterator> -typename iterator_traits<InputIterator>::difference_type -distance(InputIterator first, InputIterator last); +template <class InputIterator> // constexpr in C++17 + constexpr typename iterator_traits<InputIterator>::difference_type + distance(InputIterator first, InputIterator last); + +template <class InputIterator> // constexpr in C++17 + constexpr InputIterator next(InputIterator x, +typename iterator_traits<InputIterator>::difference_type n = 1); + +template <class BidirectionalIterator> // constexpr in C++17 + constexpr BidirectionalIterator prev(BidirectionalIterator x, + typename iterator_traits<BidirectionalIterator>::difference_type n = 1); template <class Iterator> class reverse_iterator @@ -529,7 +538,7 @@ struct _LIBCPP_TEMPLATE_VIS iterator }; template <class _InputIter> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 void __advance(_InputIter& __i, typename iterator_traits<_InputIter>::difference_type __n, input_iterator_tag) { @@ -538,7 +547,7 @@ void __advance(_InputIter& __i, } template <class _BiDirIter> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 void __advance(_BiDirIter& __i, typename iterator_traits<_BiDirIter>::difference_type __n, bidirectional_iterator_tag) { @@ -551,7 +560,7 @@ void __advance(_BiDirIter& __i, } template <class _RandIter> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 void __advance(_RandIter& __i, typename iterator_traits<_RandIter>::difference_type __n, random_access_iterator_tag) { @@ -559,7 +568,7 @@ void __advance(_RandIter& __i, } template <class _InputIter> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 void advance(_InputIter& __i, typename iterator_traits<_InputIter>::difference_type __n) { @@ -567,7 +576,7 @@ void advance(_InputIter& __i, } template <class _InputIter> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 typename iterator_traits<_InputIter>::difference_type __distance(_InputIter __first, _InputIter __last, input_iterator_tag) { @@ -578,7 +587,7 @@ __distance(_InputIter __first, _InputIte } template <class _RandIter> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 typename iterator_traits<_RandIter>::difference_type __distance(_RandIter __first, _RandIter __last, random_access_iterator_tag) { @@ -586,7 +595,7 @@ __distance(_RandIter __first, _RandIter } template <class _InputIter> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 typename iterator_traits<_InputIter>::difference_type distance(_InputIter __first, _InputIter __last) { @@ -594,7 +603,7 @@ distance(_InputIter __first, _InputIter } template <class _InputIter> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 _InputIter next(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n = 1, @@ -605,7 +614,7 @@ next(_InputIter __x, } template <class _BidiretionalIter> -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 _BidiretionalIter prev(_BidiretionalIter __x, typename iterator_traits<_BidiretionalIter>::difference_type __n = 1, Modified: projects/clang500-import/contrib/libc++/include/optional ============================================================================== --- projects/clang500-import/contrib/libc++/include/optional Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/libc++/include/optional Thu May 18 18:33:33 2017 (r318477) @@ -599,8 +599,8 @@ private: public: _LIBCPP_INLINE_VISIBILITY constexpr optional() noexcept {} - _LIBCPP_INLINE_VISIBILITY optional(const optional&) = default; - _LIBCPP_INLINE_VISIBILITY optional(optional&&) = default; + _LIBCPP_INLINE_VISIBILITY constexpr optional(const optional&) = default; + _LIBCPP_INLINE_VISIBILITY constexpr optional(optional&&) = default; _LIBCPP_INLINE_VISIBILITY constexpr optional(nullopt_t) noexcept {} template <class... _Args, class = enable_if_t< Modified: projects/clang500-import/contrib/llvm/include/llvm/ADT/APInt.h ============================================================================== --- projects/clang500-import/contrib/llvm/include/llvm/ADT/APInt.h Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/llvm/include/llvm/ADT/APInt.h Thu May 18 18:33:33 2017 (r318477) @@ -1067,9 +1067,7 @@ public: /// \returns the bit value at bitPosition bool operator[](unsigned bitPosition) const { assert(bitPosition < getBitWidth() && "Bit position out of bounds!"); - return (maskBit(bitPosition) & - (isSingleWord() ? U.VAL : U.pVal[whichWord(bitPosition)])) != - 0; + return (maskBit(bitPosition) & getWord(bitPosition)) != 0; } /// @} Modified: projects/clang500-import/contrib/llvm/include/llvm/ADT/BitVector.h ============================================================================== --- projects/clang500-import/contrib/llvm/include/llvm/ADT/BitVector.h Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/llvm/include/llvm/ADT/BitVector.h Thu May 18 18:33:33 2017 (r318477) @@ -15,6 +15,7 @@ #define LLVM_ADT_BITVECTOR_H #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/iterator_range.h" #include "llvm/Support/MathExtras.h" #include <algorithm> #include <cassert> @@ -26,6 +27,50 @@ namespace llvm { +/// ForwardIterator for the bits that are set. +/// Iterators get invalidated when resize / reserve is called. +template <typename BitVectorT> class const_set_bits_iterator_impl { + const BitVectorT &Parent; + int Current = 0; + + void advance() { + assert(Current != -1 && "Trying to advance past end."); + Current = Parent.find_next(Current); + } + +public: + const_set_bits_iterator_impl(const BitVectorT &Parent, int Current) + : Parent(Parent), Current(Current) {} + explicit const_set_bits_iterator_impl(const BitVectorT &Parent) + : const_set_bits_iterator_impl(Parent, Parent.find_first()) {} + const_set_bits_iterator_impl(const const_set_bits_iterator_impl &) = default; + + const_set_bits_iterator_impl operator++(int) { + auto Prev = *this; + advance(); + return Prev; + } + + const_set_bits_iterator_impl &operator++() { + advance(); + return *this; + } + + unsigned operator*() const { return Current; } + + bool operator==(const const_set_bits_iterator_impl &Other) const { + assert(&Parent == &Other.Parent && + "Comparing iterators from different BitVectors"); + return Current == Other.Current; + } + + bool operator!=(const const_set_bits_iterator_impl &Other) const { + assert(&Parent == &Other.Parent && + "Comparing iterators from different BitVectors"); + return Current != Other.Current; + } +}; + class BitVector { typedef unsigned long BitWord; @@ -73,6 +118,18 @@ public: } }; + typedef const_set_bits_iterator_impl<BitVector> const_set_bits_iterator; + typedef const_set_bits_iterator set_iterator; + + const_set_bits_iterator set_bits_begin() const { + return const_set_bits_iterator(*this); + } + const_set_bits_iterator set_bits_end() const { + return const_set_bits_iterator(*this, -1); + } + iterator_range<const_set_bits_iterator> set_bits() const { + return make_range(set_bits_begin(), set_bits_end()); + } /// BitVector default ctor - Creates an empty bitvector. BitVector() : Size(0) {} @@ -146,138 +203,164 @@ public: return !any(); } - /// find_first - Returns the index of the first set bit, -1 if none - /// of the bits are set. - int find_first() const { - for (unsigned i = 0; i < NumBitWords(size()); ++i) - if (Bits[i] != 0) - return i * BITWORD_SIZE + countTrailingZeros(Bits[i]); - return -1; - } - - /// find_last - Returns the index of the last set bit, -1 if none of the bits - /// are set. - int find_last() const { - if (Size == 0) + /// find_first_in - Returns the index of the first set bit in the range + /// [Begin, End). Returns -1 if all bits in the range are unset. + int find_first_in(unsigned Begin, unsigned End) const { + assert(Begin <= End && End <= Size); + if (Begin == End) return -1; - unsigned N = NumBitWords(size()); - assert(N > 0); + unsigned FirstWord = Begin / BITWORD_SIZE; + unsigned LastWord = (End - 1) / BITWORD_SIZE; - unsigned i = N - 1; - while (i > 0 && Bits[i] == BitWord(0)) - --i; + // Check subsequent words. + for (unsigned i = FirstWord; i <= LastWord; ++i) { + BitWord Copy = Bits[i]; - return int((i + 1) * BITWORD_SIZE - countLeadingZeros(Bits[i])) - 1; - } + if (i == FirstWord) { + unsigned FirstBit = Begin % BITWORD_SIZE; + Copy &= maskTrailingZeros<BitWord>(FirstBit); + } - /// find_first_unset - Returns the index of the first unset bit, -1 if all - /// of the bits are set. - int find_first_unset() const { - for (unsigned i = 0; i < NumBitWords(size()); ++i) - if (Bits[i] != ~0UL) { - unsigned Result = i * BITWORD_SIZE + countTrailingOnes(Bits[i]); - return Result < size() ? Result : -1; + if (i == LastWord) { + unsigned LastBit = (End - 1) % BITWORD_SIZE; + Copy &= maskTrailingOnes<BitWord>(LastBit + 1); } + if (Copy != 0) + return i * BITWORD_SIZE + countTrailingZeros(Copy); + } return -1; } - /// find_last_unset - Returns the index of the last unset bit, -1 if all of - /// the bits are set. - int find_last_unset() const { - if (Size == 0) + /// find_last_in - Returns the index of the last set bit in the range + /// [Begin, End). Returns -1 if all bits in the range are unset. + int find_last_in(unsigned Begin, unsigned End) const { + assert(Begin <= End && End <= Size); + if (Begin == End) return -1; - const unsigned N = NumBitWords(size()); - assert(N > 0); + unsigned LastWord = (End - 1) / BITWORD_SIZE; + unsigned FirstWord = Begin / BITWORD_SIZE; - unsigned i = N - 1; - BitWord W = Bits[i]; + for (unsigned i = LastWord + 1; i >= FirstWord + 1; --i) { + unsigned CurrentWord = i - 1; - // The last word in the BitVector has some unused bits, so we need to set - // them all to 1 first. Set them all to 1 so they don't get treated as - // valid unset bits. - unsigned UnusedCount = BITWORD_SIZE - size() % BITWORD_SIZE; - W |= maskLeadingOnes<BitWord>(UnusedCount); + BitWord Copy = Bits[CurrentWord]; + if (CurrentWord == LastWord) { + unsigned LastBit = (End - 1) % BITWORD_SIZE; + Copy &= maskTrailingOnes<BitWord>(LastBit + 1); + } - while (W == ~BitWord(0) && --i > 0) - W = Bits[i]; + if (CurrentWord == FirstWord) { + unsigned FirstBit = Begin % BITWORD_SIZE; + Copy &= maskTrailingZeros<BitWord>(FirstBit); + } + + if (Copy != 0) + return (CurrentWord + 1) * BITWORD_SIZE - countLeadingZeros(Copy) - 1; + } - return int((i + 1) * BITWORD_SIZE - countLeadingOnes(W)) - 1; + return -1; } - /// find_next - Returns the index of the next set bit following the - /// "Prev" bit. Returns -1 if the next set bit is not found. - int find_next(unsigned Prev) const { - ++Prev; - if (Prev >= Size) + /// find_first_unset_in - Returns the index of the first unset bit in the + /// range [Begin, End). Returns -1 if all bits in the range are set. + int find_first_unset_in(unsigned Begin, unsigned End) const { + assert(Begin <= End && End <= Size); + if (Begin == End) return -1; - unsigned WordPos = Prev / BITWORD_SIZE; - unsigned BitPos = Prev % BITWORD_SIZE; - BitWord Copy = Bits[WordPos]; - // Mask off previous bits. - Copy &= maskTrailingZeros<BitWord>(BitPos); - - if (Copy != 0) - return WordPos * BITWORD_SIZE + countTrailingZeros(Copy); + unsigned FirstWord = Begin / BITWORD_SIZE; + unsigned LastWord = (End - 1) / BITWORD_SIZE; // Check subsequent words. - for (unsigned i = WordPos+1; i < NumBitWords(size()); ++i) - if (Bits[i] != 0) - return i * BITWORD_SIZE + countTrailingZeros(Bits[i]); + for (unsigned i = FirstWord; i <= LastWord; ++i) { + BitWord Copy = Bits[i]; + + if (i == FirstWord) { + unsigned FirstBit = Begin % BITWORD_SIZE; + Copy |= maskTrailingOnes<BitWord>(FirstBit); + } + + if (i == LastWord) { + unsigned LastBit = (End - 1) % BITWORD_SIZE; + Copy |= maskTrailingZeros<BitWord>(LastBit + 1); + } + if (Copy != ~0UL) { + unsigned Result = i * BITWORD_SIZE + countTrailingOnes(Copy); + return Result < size() ? Result : -1; + } + } return -1; } - /// find_next_unset - Returns the index of the next unset bit following the - /// "Prev" bit. Returns -1 if all remaining bits are set. - int find_next_unset(unsigned Prev) const { - ++Prev; - if (Prev >= Size) + /// find_last_unset_in - Returns the index of the last unset bit in the + /// range [Begin, End). Returns -1 if all bits in the range are set. + int find_last_unset_in(unsigned Begin, unsigned End) const { + assert(Begin <= End && End <= Size); + if (Begin == End) return -1; - unsigned WordPos = Prev / BITWORD_SIZE; - unsigned BitPos = Prev % BITWORD_SIZE; - BitWord Copy = Bits[WordPos]; - // Mask in previous bits. - BitWord Mask = (1 << BitPos) - 1; - Copy |= Mask; + unsigned LastWord = (End - 1) / BITWORD_SIZE; + unsigned FirstWord = Begin / BITWORD_SIZE; - if (Copy != ~0UL) - return next_unset_in_word(WordPos, Copy); + for (unsigned i = LastWord + 1; i >= FirstWord + 1; --i) { + unsigned CurrentWord = i - 1; - // Check subsequent words. - for (unsigned i = WordPos + 1; i < NumBitWords(size()); ++i) - if (Bits[i] != ~0UL) - return next_unset_in_word(i, Bits[i]); + BitWord Copy = Bits[CurrentWord]; + if (CurrentWord == LastWord) { + unsigned LastBit = (End - 1) % BITWORD_SIZE; + Copy |= maskTrailingZeros<BitWord>(LastBit + 1); + } + + if (CurrentWord == FirstWord) { + unsigned FirstBit = Begin % BITWORD_SIZE; + Copy |= maskTrailingOnes<BitWord>(FirstBit); + } + + if (Copy != ~0UL) { + unsigned Result = + (CurrentWord + 1) * BITWORD_SIZE - countLeadingOnes(Copy) - 1; + return Result < Size ? Result : -1; + } + } return -1; } + /// find_first - Returns the index of the first set bit, -1 if none + /// of the bits are set. + int find_first() const { return find_first_in(0, Size); } + + /// find_last - Returns the index of the last set bit, -1 if none of the bits + /// are set. + int find_last() const { return find_last_in(0, Size); } + + /// find_next - Returns the index of the next set bit following the + /// "Prev" bit. Returns -1 if the next set bit is not found. + int find_next(unsigned Prev) const { return find_first_in(Prev + 1, Size); } + /// find_prev - Returns the index of the first set bit that precedes the /// the bit at \p PriorTo. Returns -1 if all previous bits are unset. - int find_prev(unsigned PriorTo) const { - if (PriorTo == 0) - return -1; + int find_prev(unsigned PriorTo) const { return find_last_in(0, PriorTo); } - --PriorTo; + /// find_first_unset - Returns the index of the first unset bit, -1 if all + /// of the bits are set. + int find_first_unset() const { return find_first_unset_in(0, Size); } - unsigned WordPos = PriorTo / BITWORD_SIZE; - unsigned BitPos = PriorTo % BITWORD_SIZE; - BitWord Copy = Bits[WordPos]; - // Mask off next bits. - Copy &= maskTrailingOnes<BitWord>(BitPos + 1); - - if (Copy != 0) - return (WordPos + 1) * BITWORD_SIZE - countLeadingZeros(Copy) - 1; - - // Check previous words. - for (unsigned i = 1; i <= WordPos; ++i) { - unsigned Index = WordPos - i; - if (Bits[Index] == 0) - continue; - return (Index + 1) * BITWORD_SIZE - countLeadingZeros(Bits[Index]) - 1; - } - return -1; + /// find_next_unset - Returns the index of the next unset bit following the + /// "Prev" bit. Returns -1 if all remaining bits are set. + int find_next_unset(unsigned Prev) const { + return find_first_unset_in(Prev + 1, Size); + } + + /// find_last_unset - Returns the index of the last unset bit, -1 if all of + /// the bits are set. + int find_last_unset() const { return find_last_unset_in(0, Size); } + + /// find_prev_unset - Returns the index of the first unset bit that precedes + /// the bit at \p PriorTo. Returns -1 if all previous bits are set. + int find_prev_unset(unsigned PriorTo) { + return find_last_unset_in(0, PriorTo); } /// clear - Removes all bits from the bitvector. Does not change capacity. Modified: projects/clang500-import/contrib/llvm/include/llvm/ADT/PostOrderIterator.h ============================================================================== --- projects/clang500-import/contrib/llvm/include/llvm/ADT/PostOrderIterator.h Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/llvm/include/llvm/ADT/PostOrderIterator.h Thu May 18 18:33:33 2017 (r318477) @@ -96,24 +96,14 @@ template <class GraphT, class po_iterator : public std::iterator<std::forward_iterator_tag, typename GT::NodeRef>, public po_iterator_storage<SetType, ExtStorage> { - typedef std::iterator<std::forward_iterator_tag, typename GT::NodeRef> super; - typedef typename GT::NodeRef NodeRef; - typedef typename GT::ChildIteratorType ChildItTy; + using super = std::iterator<std::forward_iterator_tag, typename GT::NodeRef>; + using NodeRef = typename GT::NodeRef; + using ChildItTy = typename GT::ChildIteratorType; // VisitStack - Used to maintain the ordering. Top = current block // First element is basic block pointer, second is the 'next child' to visit std::vector<std::pair<NodeRef, ChildItTy>> VisitStack; - void traverseChild() { - while (VisitStack.back().second != GT::child_end(VisitStack.back().first)) { - NodeRef BB = *VisitStack.back().second++; - if (this->insertEdge(Optional<NodeRef>(VisitStack.back().first), BB)) { - // If the block is not visited... - VisitStack.push_back(std::make_pair(BB, GT::child_begin(BB))); - } - } - } - po_iterator(NodeRef BB) { this->insertEdge(Optional<NodeRef>(), BB); VisitStack.push_back(std::make_pair(BB, GT::child_begin(BB))); @@ -134,8 +124,18 @@ class po_iterator : po_iterator_storage<SetType, ExtStorage>(S) { } // End is when stack is empty. + void traverseChild() { + while (VisitStack.back().second != GT::child_end(VisitStack.back().first)) { + NodeRef BB = *VisitStack.back().second++; + if (this->insertEdge(Optional<NodeRef>(VisitStack.back().first), BB)) { + // If the block is not visited... + VisitStack.push_back(std::make_pair(BB, GT::child_begin(BB))); + } + } + } + public: - typedef typename super::pointer pointer; + using pointer = typename super::pointer; // Provide static "constructors"... static po_iterator begin(GraphT G) { @@ -286,7 +286,8 @@ inverse_post_order_ext(const T &G, SetTy template<class GraphT, class GT = GraphTraits<GraphT>> class ReversePostOrderTraversal { - typedef typename GT::NodeRef NodeRef; + using NodeRef = typename GT::NodeRef; + std::vector<NodeRef> Blocks; // Block list in normal PO order void Initialize(NodeRef BB) { @@ -294,7 +295,7 @@ class ReversePostOrderTraversal { } public: - typedef typename std::vector<NodeRef>::reverse_iterator rpo_iterator; + using rpo_iterator = typename std::vector<NodeRef>::reverse_iterator; ReversePostOrderTraversal(GraphT G) { Initialize(GT::getEntryNode(G)); } Modified: projects/clang500-import/contrib/llvm/include/llvm/ADT/PriorityWorklist.h ============================================================================== --- projects/clang500-import/contrib/llvm/include/llvm/ADT/PriorityWorklist.h Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/llvm/include/llvm/ADT/PriorityWorklist.h Thu May 18 18:33:33 2017 (r318477) @@ -17,13 +17,14 @@ #define LLVM_ADT_PRIORITYWORKLIST_H #include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/Sequence.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Support/Compiler.h" #include <algorithm> #include <cassert> #include <cstddef> +#include <iterator> +#include <type_traits> #include <vector> namespace llvm { @@ -55,11 +56,11 @@ template <typename T, typename VectorT = typename MapT = DenseMap<T, ptrdiff_t>> class PriorityWorklist { public: - typedef T value_type; - typedef T key_type; - typedef T& reference; - typedef const T& const_reference; - typedef typename MapT::size_type size_type; + using value_type = T; + using key_type = T; + using reference = T&; + using const_reference = const T&; + using size_type = typename MapT::size_type; /// Construct an empty PriorityWorklist PriorityWorklist() = default; Modified: projects/clang500-import/contrib/llvm/include/llvm/ADT/SCCIterator.h ============================================================================== --- projects/clang500-import/contrib/llvm/include/llvm/ADT/SCCIterator.h Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/llvm/include/llvm/ADT/SCCIterator.h Thu May 18 18:33:33 2017 (r318477) @@ -1,4 +1,4 @@ -//===---- ADT/SCCIterator.h - Strongly Connected Comp. Iter. ----*- C++ -*-===// +//===- ADT/SCCIterator.h - Strongly Connected Comp. Iter. -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -43,10 +43,10 @@ template <class GraphT, class GT = Graph class scc_iterator : public iterator_facade_base< scc_iterator<GraphT, GT>, std::forward_iterator_tag, const std::vector<typename GT::NodeRef>, ptrdiff_t> { - typedef typename GT::NodeRef NodeRef; - typedef typename GT::ChildIteratorType ChildItTy; - typedef std::vector<NodeRef> SccTy; - typedef typename scc_iterator::reference reference; + using NodeRef = typename GT::NodeRef; + using ChildItTy = typename GT::ChildIteratorType; + using SccTy = std::vector<NodeRef>; + using reference = typename scc_iterator::reference; /// Element of VisitStack during DFS. struct StackElement { Modified: projects/clang500-import/contrib/llvm/include/llvm/ADT/Sequence.h ============================================================================== --- projects/clang500-import/contrib/llvm/include/llvm/ADT/Sequence.h Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/llvm/include/llvm/ADT/Sequence.h Thu May 18 18:33:33 2017 (r318477) @@ -13,27 +13,31 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLVM_ADT_SEQ_H -#define LLVM_ADT_SEQ_H +#ifndef LLVM_ADT_SEQUENCE_H +#define LLVM_ADT_SEQUENCE_H #include "llvm/ADT/iterator.h" #include "llvm/ADT/iterator_range.h" +#include <algorithm> +#include <iterator> +#include <utility> namespace llvm { namespace detail { + template <typename ValueT> class value_sequence_iterator : public iterator_facade_base<value_sequence_iterator<ValueT>, std::random_access_iterator_tag, const ValueT> { - typedef typename value_sequence_iterator::iterator_facade_base BaseT; + using BaseT = typename value_sequence_iterator::iterator_facade_base; ValueT Value; public: - typedef typename BaseT::difference_type difference_type; - typedef typename BaseT::reference reference; + using difference_type = typename BaseT::difference_type; + using reference = typename BaseT::reference; value_sequence_iterator() = default; value_sequence_iterator(const value_sequence_iterator &) = default; @@ -65,7 +69,8 @@ public: reference operator*() const { return Value; } }; -} // End detail namespace. + +} // end namespace detail template <typename ValueT> iterator_range<detail::value_sequence_iterator<ValueT>> seq(ValueT Begin, @@ -74,6 +79,6 @@ iterator_range<detail::value_sequence_it detail::value_sequence_iterator<ValueT>(End)); } -} +} // end namespace llvm -#endif +#endif // LLVM_ADT_SEQUENCE_H Modified: projects/clang500-import/contrib/llvm/include/llvm/ADT/SetVector.h ============================================================================== --- projects/clang500-import/contrib/llvm/include/llvm/ADT/SetVector.h Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/llvm/include/llvm/ADT/SetVector.h Thu May 18 18:33:33 2017 (r318477) @@ -40,17 +40,17 @@ template <typename T, typename Vector = typename Set = DenseSet<T>> class SetVector { public: - typedef T value_type; - typedef T key_type; - typedef T& reference; - typedef const T& const_reference; - typedef Set set_type; - typedef Vector vector_type; - typedef typename vector_type::const_iterator iterator; - typedef typename vector_type::const_iterator const_iterator; - typedef typename vector_type::const_reverse_iterator reverse_iterator; - typedef typename vector_type::const_reverse_iterator const_reverse_iterator; - typedef typename vector_type::size_type size_type; + using value_type = T; + using key_type = T; + using reference = T&; + using const_reference = const T&; + using set_type = Set; + using vector_type = Vector; + using iterator = typename vector_type::const_iterator; + using const_iterator = typename vector_type::const_iterator; + using reverse_iterator = typename vector_type::const_reverse_iterator; + using const_reverse_iterator = typename vector_type::const_reverse_iterator; + using size_type = typename vector_type::size_type; /// \brief Construct an empty SetVector SetVector() = default; Modified: projects/clang500-import/contrib/llvm/include/llvm/ADT/SmallBitVector.h ============================================================================== --- projects/clang500-import/contrib/llvm/include/llvm/ADT/SmallBitVector.h Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/llvm/include/llvm/ADT/SmallBitVector.h Thu May 18 18:33:33 2017 (r318477) @@ -134,6 +134,19 @@ private: } public: + typedef const_set_bits_iterator_impl<SmallBitVector> const_set_bits_iterator; + typedef const_set_bits_iterator set_iterator; + + const_set_bits_iterator set_bits_begin() const { + return const_set_bits_iterator(*this); + } + const_set_bits_iterator set_bits_end() const { + return const_set_bits_iterator(*this, -1); + } + iterator_range<const_set_bits_iterator> set_bits() const { + return make_range(set_bits_begin(), set_bits_end()); + } + /// Creates an empty bitvector. SmallBitVector() : X(1) {} Modified: projects/clang500-import/contrib/llvm/include/llvm/ADT/SmallPtrSet.h ============================================================================== --- projects/clang500-import/contrib/llvm/include/llvm/ADT/SmallPtrSet.h Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/llvm/include/llvm/ADT/SmallPtrSet.h Thu May 18 18:33:33 2017 (r318477) @@ -27,15 +27,13 @@ #include <iterator> #include <utility> -#if LLVM_ENABLE_ABI_BREAKING_CHECKS namespace llvm { + +#if LLVM_ENABLE_ABI_BREAKING_CHECKS template <class T = void> struct ReverseIterate { static bool value; }; template <class T> bool ReverseIterate<T>::value = false; -} #endif -namespace llvm { - /// SmallPtrSetImplBase - This is the common code shared among all the /// SmallPtrSet<>'s, which is almost everything. SmallPtrSet has two modes, one /// for small and one for large sets. @@ -92,7 +90,7 @@ protected: } public: - typedef unsigned size_type; + using size_type = unsigned; SmallPtrSetImplBase &operator=(const SmallPtrSetImplBase &) = delete; @@ -273,14 +271,14 @@ protected: /// SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet. template<typename PtrTy> class SmallPtrSetIterator : public SmallPtrSetIteratorImpl { - typedef PointerLikeTypeTraits<PtrTy> PtrTraits; + using PtrTraits = PointerLikeTypeTraits<PtrTy>; public: - typedef PtrTy value_type; - typedef PtrTy reference; - typedef PtrTy pointer; - typedef std::ptrdiff_t difference_type; - typedef std::forward_iterator_tag iterator_category; + using value_type = PtrTy; + using reference = PtrTy; + using pointer = PtrTy; + using difference_type = std::ptrdiff_t; + using iterator_category = std::forward_iterator_tag; explicit SmallPtrSetIterator(const void *const *BP, const void *const *E) : SmallPtrSetIteratorImpl(BP, E) {} @@ -351,8 +349,8 @@ struct RoundUpToPowerOfTwo { template <typename PtrType> class SmallPtrSetImpl : public SmallPtrSetImplBase { using ConstPtrType = typename add_const_past_pointer<PtrType>::type; - typedef PointerLikeTypeTraits<PtrType> PtrTraits; - typedef PointerLikeTypeTraits<ConstPtrType> ConstPtrTraits; + using PtrTraits = PointerLikeTypeTraits<PtrType>; + using ConstPtrTraits = PointerLikeTypeTraits<ConstPtrType>; protected: // Constructors that forward to the base. @@ -365,8 +363,8 @@ protected: : SmallPtrSetImplBase(SmallStorage, SmallSize) {} public: - typedef SmallPtrSetIterator<PtrType> iterator; - typedef SmallPtrSetIterator<PtrType> const_iterator; + using iterator = SmallPtrSetIterator<PtrType>; + using const_iterator = SmallPtrSetIterator<PtrType>; SmallPtrSetImpl(const SmallPtrSetImpl &) = delete; @@ -431,7 +429,7 @@ class SmallPtrSet : public SmallPtrSetIm // DenseSet<> instead if you expect many elements in the set. static_assert(SmallSize <= 32, "SmallSize should be small"); - typedef SmallPtrSetImpl<PtrType> BaseT; + using BaseT = SmallPtrSetImpl<PtrType>; // Make sure that SmallSize is a power of two, round up if not. enum { SmallSizePowTwo = RoundUpToPowerOfTwo<SmallSize>::Val }; Modified: projects/clang500-import/contrib/llvm/include/llvm/ADT/SmallVector.h ============================================================================== --- projects/clang500-import/contrib/llvm/include/llvm/ADT/SmallVector.h Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/llvm/include/llvm/ADT/SmallVector.h Thu May 18 18:33:33 2017 (r318477) @@ -71,7 +71,7 @@ private: // Allocate raw space for N elements of type T. If T has a ctor or dtor, we // don't want it to be automatically run, so we need to represent the space as // something else. Use an array of char of sufficient alignment. - typedef AlignedCharArrayUnion<T> U; + using U = AlignedCharArrayUnion<T>; U FirstEl; // Space after 'FirstEl' is clobbered, do not add any instance vars after it. @@ -96,19 +96,19 @@ protected: void setEnd(T *P) { this->EndX = P; } public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef T *iterator; - typedef const T *const_iterator; - - typedef std::reverse_iterator<const_iterator> const_reverse_iterator; - typedef std::reverse_iterator<iterator> reverse_iterator; - - typedef T &reference; - typedef const T &const_reference; - typedef T *pointer; - typedef const T *const_pointer; + using size_type = size_t; + using difference_type = ptrdiff_t; + using value_type = T; + using iterator = T *; + using const_iterator = const T *; + + using const_reverse_iterator = std::reverse_iterator<const_iterator>; + using reverse_iterator = std::reverse_iterator<iterator>; + + using reference = T &; + using const_reference = const T &; + using pointer = T *; + using const_pointer = const T *; // forward iterator creation methods. LLVM_ATTRIBUTE_ALWAYS_INLINE @@ -319,12 +319,12 @@ public: /// reduce code duplication based on the SmallVector 'N' template parameter. template <typename T> class SmallVectorImpl : public SmallVectorTemplateBase<T, isPodLike<T>::value> { - typedef SmallVectorTemplateBase<T, isPodLike<T>::value > SuperClass; + using SuperClass = SmallVectorTemplateBase<T, isPodLike<T>::value>; public: - typedef typename SuperClass::iterator iterator; - typedef typename SuperClass::const_iterator const_iterator; - typedef typename SuperClass::size_type size_type; + using iterator = typename SuperClass::iterator; + using const_iterator = typename SuperClass::const_iterator; + using size_type = typename SuperClass::size_type; protected: // Default ctor - Initialize to empty. @@ -845,8 +845,7 @@ class SmallVector : public SmallVectorIm SmallVectorStorage<T, N> Storage; public: - SmallVector() : SmallVectorImpl<T>(N) { - } + SmallVector() : SmallVectorImpl<T>(N) {} explicit SmallVector(size_t Size, const T &Value = T()) : SmallVectorImpl<T>(N) { @@ -883,16 +882,16 @@ public: SmallVectorImpl<T>::operator=(::std::move(RHS)); } - const SmallVector &operator=(SmallVector &&RHS) { - SmallVectorImpl<T>::operator=(::std::move(RHS)); - return *this; - } - SmallVector(SmallVectorImpl<T> &&RHS) : SmallVectorImpl<T>(N) { if (!RHS.empty()) SmallVectorImpl<T>::operator=(::std::move(RHS)); } + const SmallVector &operator=(SmallVector &&RHS) { + SmallVectorImpl<T>::operator=(::std::move(RHS)); + return *this; + } + const SmallVector &operator=(SmallVectorImpl<T> &&RHS) { SmallVectorImpl<T>::operator=(::std::move(RHS)); return *this; Modified: projects/clang500-import/contrib/llvm/include/llvm/ADT/SparseBitVector.h ============================================================================== --- projects/clang500-import/contrib/llvm/include/llvm/ADT/SparseBitVector.h Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/llvm/include/llvm/ADT/SparseBitVector.h Thu May 18 18:33:33 2017 (r318477) @@ -1,4 +1,4 @@ -//===- llvm/ADT/SparseBitVector.h - Efficient Sparse BitVector -*- C++ -*- ===// +//===- llvm/ADT/SparseBitVector.h - Efficient Sparse BitVector --*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -41,8 +41,8 @@ namespace llvm { template <unsigned ElementSize = 128> struct SparseBitVectorElement { public: - typedef unsigned long BitWord; - typedef unsigned size_type; + using BitWord = unsigned long; + using size_type = unsigned; enum { BITWORD_SIZE = sizeof(BitWord) * CHAR_BIT, BITWORDS_PER_ELEMENT = (ElementSize + BITWORD_SIZE - 1) / BITWORD_SIZE, @@ -100,7 +100,7 @@ public: Bits[Idx / BITWORD_SIZE] |= 1L << (Idx % BITWORD_SIZE); } - bool test_and_set (unsigned Idx) { + bool test_and_set(unsigned Idx) { bool old = test(Idx); if (!old) { set(Idx); @@ -254,9 +254,9 @@ public: template <unsigned ElementSize = 128> class SparseBitVector { - typedef std::list<SparseBitVectorElement<ElementSize>> ElementList; - typedef typename ElementList::iterator ElementListIter; - typedef typename ElementList::const_iterator ElementListConstIter; + using ElementList = std::list<SparseBitVectorElement<ElementSize>>; + using ElementListIter = typename ElementList::iterator; + using ElementListConstIter = typename ElementList::const_iterator; enum { BITWORD_SIZE = SparseBitVectorElement<ElementSize>::BITWORD_SIZE }; @@ -421,14 +421,12 @@ class SparseBitVector { }; public: - typedef SparseBitVectorIterator iterator; + using iterator = SparseBitVectorIterator; SparseBitVector() { CurrElementIter = Elements.begin(); } - ~SparseBitVector() = default; - // SparseBitVector copy ctor. SparseBitVector(const SparseBitVector &RHS) { ElementListConstIter ElementIter = RHS.Elements.begin(); @@ -440,6 +438,8 @@ public: CurrElementIter = Elements.begin (); } + ~SparseBitVector() = default; + // Clear. void clear() { Elements.clear(); Modified: projects/clang500-import/contrib/llvm/include/llvm/ADT/SparseMultiSet.h ============================================================================== --- projects/clang500-import/contrib/llvm/include/llvm/ADT/SparseMultiSet.h Thu May 18 18:24:11 2017 (r318476) +++ projects/clang500-import/contrib/llvm/include/llvm/ADT/SparseMultiSet.h Thu May 18 18:33:33 2017 (r318477) @@ -1,4 +1,4 @@ -//===--- llvm/ADT/SparseMultiSet.h - Sparse multiset ------------*- C++ -*-===// +//===- llvm/ADT/SparseMultiSet.h - Sparse multiset --------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -101,7 +101,7 @@ class SparseMultiSet { unsigned Prev; unsigned Next; - SMSNode(ValueT D, unsigned P, unsigned N) : Data(D), Prev(P), Next(N) { } + SMSNode(ValueT D, unsigned P, unsigned N) : Data(D), Prev(P), Next(N) {} /// List tails have invalid Nexts. bool isTail() const { @@ -118,8 +118,8 @@ class SparseMultiSet { bool isValid() const { return Prev != INVALID; } }; - typedef typename KeyFunctorT::argument_type KeyT; - typedef SmallVector<SMSNode, 8> DenseT; + using KeyT = typename KeyFunctorT::argument_type; + using DenseT = SmallVector<SMSNode, 8>; DenseT Dense; SparseT *Sparse = nullptr; unsigned Universe = 0; @@ -183,12 +183,12 @@ class SparseMultiSet { } *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705181833.v4IIXYTr066932>