From owner-svn-src-vendor@freebsd.org Wed May 17 20:22:43 2017 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F24CCD714A3; Wed, 17 May 2017 20:22:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7CA61BF2; Wed, 17 May 2017 20:22:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4HKMfhW015248; Wed, 17 May 2017 20:22:41 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4HKMeJf015232; Wed, 17 May 2017 20:22:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705172022.v4HKMeJf015232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 May 2017 20:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r318414 - in vendor/llvm/dist: include/llvm/ADT include/llvm/Analysis include/llvm/DebugInfo/CodeView include/llvm/DebugInfo/DWARF include/llvm/DebugInfo/PDB/Native include/llvm/IR incl... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 May 2017 20:22:43 -0000 Author: dim Date: Wed May 17 20:22:39 2017 New Revision: 318414 URL: https://svnweb.freebsd.org/changeset/base/318414 Log: Vendor import of llvm trunk r303291: https://llvm.org/svn/llvm-project/llvm/trunk@303291 Added: vendor/llvm/dist/test/Analysis/CostModel/SystemZ/div-pow2.ll vendor/llvm/dist/test/Analysis/CostModel/X86/ctlz.ll vendor/llvm/dist/test/Analysis/CostModel/X86/ctpop.ll vendor/llvm/dist/test/Analysis/CostModel/X86/cttz.ll vendor/llvm/dist/test/CodeGen/AMDGPU/packed-op-sel.ll vendor/llvm/dist/test/CodeGen/PowerPC/save-bp.ll vendor/llvm/dist/test/CodeGen/PowerPC/save-cr-ppc32svr4.ll vendor/llvm/dist/test/CodeGen/PowerPC/save-crbp-ppc32svr4.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/regbankselect-X32.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-add-x32.mir vendor/llvm/dist/test/ExecutionEngine/RuntimeDyld/X86/ELF_x86-64_debug_frame.s (contents, props changed) vendor/llvm/dist/test/Transforms/Coroutines/coro-catchswitch.ll vendor/llvm/dist/test/Transforms/InstCombine/debuginfo-skip.ll vendor/llvm/dist/test/Transforms/LoopVectorize/AArch64/pr33053.ll vendor/llvm/dist/unittests/Support/CrashRecoveryTest.cpp (contents, props changed) Deleted: vendor/llvm/dist/test/Analysis/CostModel/X86/ctbits-cost.ll vendor/llvm/dist/test/CodeGen/X86/leaFixup32.mir vendor/llvm/dist/test/CodeGen/X86/leaFixup64.mir Modified: vendor/llvm/dist/include/llvm/ADT/APInt.h vendor/llvm/dist/include/llvm/ADT/BitVector.h vendor/llvm/dist/include/llvm/ADT/PostOrderIterator.h vendor/llvm/dist/include/llvm/ADT/PriorityWorklist.h vendor/llvm/dist/include/llvm/ADT/SCCIterator.h vendor/llvm/dist/include/llvm/ADT/Sequence.h vendor/llvm/dist/include/llvm/ADT/SetVector.h vendor/llvm/dist/include/llvm/ADT/SmallBitVector.h vendor/llvm/dist/include/llvm/ADT/SmallPtrSet.h vendor/llvm/dist/include/llvm/ADT/SmallVector.h vendor/llvm/dist/include/llvm/ADT/SparseBitVector.h vendor/llvm/dist/include/llvm/ADT/SparseMultiSet.h vendor/llvm/dist/include/llvm/ADT/SparseSet.h vendor/llvm/dist/include/llvm/ADT/StringExtras.h vendor/llvm/dist/include/llvm/ADT/StringMap.h vendor/llvm/dist/include/llvm/ADT/StringRef.h vendor/llvm/dist/include/llvm/ADT/StringSet.h vendor/llvm/dist/include/llvm/ADT/TinyPtrVector.h vendor/llvm/dist/include/llvm/ADT/UniqueVector.h vendor/llvm/dist/include/llvm/Analysis/ProfileSummaryInfo.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/RandomAccessTypeVisitor.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFAttribute.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDie.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFFormValue.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFUnit.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/TpiStream.h vendor/llvm/dist/include/llvm/IR/IntrinsicsPowerPC.td vendor/llvm/dist/include/llvm/Target/GlobalISel/SelectionDAGCompat.td vendor/llvm/dist/lib/Analysis/DependenceAnalysis.cpp vendor/llvm/dist/lib/Analysis/InlineCost.cpp vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist/lib/Analysis/ProfileSummaryInfo.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/CodeGen/AggressiveAntiDepBreaker.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/IRTranslator.cpp vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp vendor/llvm/dist/lib/CodeGen/RegAllocGreedy.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SpillPlacement.cpp vendor/llvm/dist/lib/CodeGen/StackColoring.cpp vendor/llvm/dist/lib/CodeGen/TargetLoweringBase.cpp vendor/llvm/dist/lib/CodeGen/TargetPassConfig.cpp vendor/llvm/dist/lib/CodeGen/TargetRegisterInfo.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/CVTypeDumper.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/CVTypeVisitor.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/RandomAccessTypeVisitor.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeStreamMerger.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFContext.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/PDBTypeServerHandler.cpp vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp vendor/llvm/dist/lib/Support/CrashRecoveryContext.cpp vendor/llvm/dist/lib/Support/Unix/Path.inc vendor/llvm/dist/lib/Target/AArch64/AArch64FrameLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.h vendor/llvm/dist/lib/Target/AArch64/AArch64TargetTransformInfo.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64TargetTransformInfo.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUSubtarget.h vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/VOP3Instructions.td vendor/llvm/dist/lib/Target/ARM/ARMInstructionSelector.cpp vendor/llvm/dist/lib/Target/ARM/Thumb1FrameLowering.cpp vendor/llvm/dist/lib/Target/Mips/MipsDelaySlotFiller.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCFrameLowering.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.h vendor/llvm/dist/lib/Target/PowerPC/PPCInstr64Bit.td vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.td vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyRegColoring.cpp vendor/llvm/dist/lib/Target/WebAssembly/known_gcc_test_failures.txt vendor/llvm/dist/lib/Target/X86/X86.td vendor/llvm/dist/lib/Target/X86/X86FixupLEAs.cpp vendor/llvm/dist/lib/Target/X86/X86InstructionSelector.cpp vendor/llvm/dist/lib/Target/X86/X86LegalizerInfo.cpp vendor/llvm/dist/lib/Target/X86/X86Subtarget.h vendor/llvm/dist/lib/Target/X86/X86TargetMachine.cpp vendor/llvm/dist/lib/Target/X86/X86TargetTransformInfo.cpp vendor/llvm/dist/lib/Transforms/Coroutines/CoroFrame.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineInternal.h vendor/llvm/dist/lib/Transforms/InstCombine/InstructionCombining.cpp vendor/llvm/dist/lib/Transforms/Scalar/LICM.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopIdiomRecognize.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopStrengthReduce.cpp vendor/llvm/dist/lib/Transforms/Scalar/NewGVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/Reassociate.cpp vendor/llvm/dist/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp vendor/llvm/dist/test/Analysis/CostModel/X86/bitreverse.ll vendor/llvm/dist/test/CodeGen/AArch64/aarch64-addv.ll vendor/llvm/dist/test/CodeGen/AArch64/aarch64-minmaxv.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-vabs.ll vendor/llvm/dist/test/CodeGen/AArch64/ldst-zero.ll vendor/llvm/dist/test/CodeGen/AArch64/misched-stp.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fmax3.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fmin3.ll vendor/llvm/dist/test/CodeGen/AMDGPU/global-constant.ll vendor/llvm/dist/test/CodeGen/AMDGPU/immv216.ll vendor/llvm/dist/test/CodeGen/AMDGPU/max3.ll vendor/llvm/dist/test/CodeGen/AMDGPU/min3.ll vendor/llvm/dist/test/CodeGen/ARM/2011-02-04-AntidepMultidef.ll vendor/llvm/dist/test/CodeGen/ARM/2012-10-04-AAPCS-byval-align8.ll vendor/llvm/dist/test/CodeGen/ARM/dag-combine-ldst.ll vendor/llvm/dist/test/CodeGen/MSP430/vararg.ll vendor/llvm/dist/test/CodeGen/Mips/msa/bmzi_bmnzi.ll vendor/llvm/dist/test/CodeGen/PowerPC/atomic-2.ll vendor/llvm/dist/test/CodeGen/PowerPC/atomics-indexed.ll vendor/llvm/dist/test/CodeGen/PowerPC/atomics-regression.ll vendor/llvm/dist/test/CodeGen/PowerPC/atomics.ll vendor/llvm/dist/test/CodeGen/PowerPC/ppcf128sf.ll vendor/llvm/dist/test/CodeGen/SPARC/32abi.ll vendor/llvm/dist/test/CodeGen/SPARC/64abi.ll vendor/llvm/dist/test/CodeGen/SystemZ/swift-return.ll vendor/llvm/dist/test/CodeGen/Thumb/stack-access.ll vendor/llvm/dist/test/CodeGen/Thumb2/ldr-str-imm12.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/add-scalar.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/legalize-add.mir vendor/llvm/dist/test/CodeGen/X86/arg-copy-elide.ll vendor/llvm/dist/test/CodeGen/X86/nontemporal.ll vendor/llvm/dist/test/CodeGen/X86/psubus.ll vendor/llvm/dist/test/CodeGen/X86/store-narrow.ll vendor/llvm/dist/test/CodeGen/X86/swift-return.ll vendor/llvm/dist/test/CodeGen/X86/win32-spill-xmm.ll vendor/llvm/dist/test/CodeGen/X86/win64_sibcall.ll vendor/llvm/dist/test/CodeGen/X86/win64_vararg.ll vendor/llvm/dist/test/CodeGen/X86/x86-64-ms_abi-vararg.ll vendor/llvm/dist/test/Feature/optnone-llc.ll vendor/llvm/dist/test/MC/AMDGPU/vop3-gfx9.s vendor/llvm/dist/test/TableGen/GlobalISelEmitter.td vendor/llvm/dist/test/Transforms/Inline/inline-hot-callee.ll vendor/llvm/dist/test/Transforms/InstCombine/canonicalize_branch.ll vendor/llvm/dist/test/Transforms/InstSimplify/AndOrXor.ll vendor/llvm/dist/test/Transforms/LoopVectorize/AArch64/reduction-small-size.ll vendor/llvm/dist/test/Transforms/NewGVN/pr32934.ll vendor/llvm/dist/test/Transforms/SLPVectorizer/AArch64/gather-root.ll vendor/llvm/dist/tools/llvm-pdbdump/Analyze.cpp vendor/llvm/dist/tools/llvm-pdbdump/LLVMOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbdump/PdbYaml.cpp vendor/llvm/dist/tools/llvm-pdbdump/YamlTypeDumper.cpp vendor/llvm/dist/unittests/ADT/BitVectorTest.cpp vendor/llvm/dist/unittests/Analysis/ProfileSummaryInfoTest.cpp vendor/llvm/dist/unittests/DebugInfo/CodeView/RandomAccessVisitorTest.cpp vendor/llvm/dist/unittests/DebugInfo/PDB/TypeServerHandlerTest.cpp vendor/llvm/dist/unittests/Support/BinaryStreamTest.cpp vendor/llvm/dist/unittests/Support/CMakeLists.txt vendor/llvm/dist/utils/TableGen/AsmMatcherEmitter.cpp vendor/llvm/dist/utils/TableGen/GlobalISelEmitter.cpp vendor/llvm/dist/utils/lit/lit/main.py vendor/llvm/dist/utils/lit/lit/run.py Modified: vendor/llvm/dist/include/llvm/ADT/APInt.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/APInt.h Wed May 17 19:34:36 2017 (r318413) +++ vendor/llvm/dist/include/llvm/ADT/APInt.h Wed May 17 20:22:39 2017 (r318414) @@ -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: vendor/llvm/dist/include/llvm/ADT/BitVector.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/BitVector.h Wed May 17 19:34:36 2017 (r318413) +++ vendor/llvm/dist/include/llvm/ADT/BitVector.h Wed May 17 20:22:39 2017 (r318414) @@ -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 #include @@ -26,6 +27,50 @@ namespace llvm { +/// ForwardIterator for the bits that are set. +/// Iterators get invalidated when resize / reserve is called. +template 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 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 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(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(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(UnusedCount); + BitWord Copy = Bits[CurrentWord]; + if (CurrentWord == LastWord) { + unsigned LastBit = (End - 1) % BITWORD_SIZE; + Copy &= maskTrailingOnes(LastBit + 1); + } - while (W == ~BitWord(0) && --i > 0) - W = Bits[i]; + if (CurrentWord == FirstWord) { + unsigned FirstBit = Begin % BITWORD_SIZE; + Copy &= maskTrailingZeros(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(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(FirstBit); + } + + if (i == LastWord) { + unsigned LastBit = (End - 1) % BITWORD_SIZE; + Copy |= maskTrailingZeros(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(LastBit + 1); + } + + if (CurrentWord == FirstWord) { + unsigned FirstBit = Begin % BITWORD_SIZE; + Copy |= maskTrailingOnes(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(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: vendor/llvm/dist/include/llvm/ADT/PostOrderIterator.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/PostOrderIterator.h Wed May 17 19:34:36 2017 (r318413) +++ vendor/llvm/dist/include/llvm/ADT/PostOrderIterator.h Wed May 17 20:22:39 2017 (r318414) @@ -96,24 +96,14 @@ template , public po_iterator_storage { - typedef std::iterator super; - typedef typename GT::NodeRef NodeRef; - typedef typename GT::ChildIteratorType ChildItTy; + using super = std::iterator; + 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> VisitStack; - void traverseChild() { - while (VisitStack.back().second != GT::child_end(VisitStack.back().first)) { - NodeRef BB = *VisitStack.back().second++; - if (this->insertEdge(Optional(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(), BB); VisitStack.push_back(std::make_pair(BB, GT::child_begin(BB))); @@ -134,8 +124,18 @@ class po_iterator : po_iterator_storage(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(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 ReversePostOrderTraversal { - typedef typename GT::NodeRef NodeRef; + using NodeRef = typename GT::NodeRef; + std::vector Blocks; // Block list in normal PO order void Initialize(NodeRef BB) { @@ -294,7 +295,7 @@ class ReversePostOrderTraversal { } public: - typedef typename std::vector::reverse_iterator rpo_iterator; + using rpo_iterator = typename std::vector::reverse_iterator; ReversePostOrderTraversal(GraphT G) { Initialize(GT::getEntryNode(G)); } Modified: vendor/llvm/dist/include/llvm/ADT/PriorityWorklist.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/PriorityWorklist.h Wed May 17 19:34:36 2017 (r318413) +++ vendor/llvm/dist/include/llvm/ADT/PriorityWorklist.h Wed May 17 20:22:39 2017 (r318414) @@ -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 #include #include +#include +#include #include namespace llvm { @@ -55,11 +56,11 @@ template > 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: vendor/llvm/dist/include/llvm/ADT/SCCIterator.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/SCCIterator.h Wed May 17 19:34:36 2017 (r318413) +++ vendor/llvm/dist/include/llvm/ADT/SCCIterator.h Wed May 17 20:22:39 2017 (r318414) @@ -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 , std::forward_iterator_tag, const std::vector, ptrdiff_t> { - typedef typename GT::NodeRef NodeRef; - typedef typename GT::ChildIteratorType ChildItTy; - typedef std::vector SccTy; - typedef typename scc_iterator::reference reference; + using NodeRef = typename GT::NodeRef; + using ChildItTy = typename GT::ChildIteratorType; + using SccTy = std::vector; + using reference = typename scc_iterator::reference; /// Element of VisitStack during DFS. struct StackElement { Modified: vendor/llvm/dist/include/llvm/ADT/Sequence.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/Sequence.h Wed May 17 19:34:36 2017 (r318413) +++ vendor/llvm/dist/include/llvm/ADT/Sequence.h Wed May 17 20:22:39 2017 (r318414) @@ -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 +#include +#include namespace llvm { namespace detail { + template class value_sequence_iterator : public iterator_facade_base, 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 iterator_range> seq(ValueT Begin, @@ -74,6 +79,6 @@ iterator_range(End)); } -} +} // end namespace llvm -#endif +#endif // LLVM_ADT_SEQUENCE_H Modified: vendor/llvm/dist/include/llvm/ADT/SetVector.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/SetVector.h Wed May 17 19:34:36 2017 (r318413) +++ vendor/llvm/dist/include/llvm/ADT/SetVector.h Wed May 17 20:22:39 2017 (r318414) @@ -40,17 +40,17 @@ template > 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: vendor/llvm/dist/include/llvm/ADT/SmallBitVector.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/SmallBitVector.h Wed May 17 19:34:36 2017 (r318413) +++ vendor/llvm/dist/include/llvm/ADT/SmallBitVector.h Wed May 17 20:22:39 2017 (r318414) @@ -134,6 +134,19 @@ private: } public: + typedef const_set_bits_iterator_impl 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 set_bits() const { + return make_range(set_bits_begin(), set_bits_end()); + } + /// Creates an empty bitvector. SmallBitVector() : X(1) {} Modified: vendor/llvm/dist/include/llvm/ADT/SmallPtrSet.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/SmallPtrSet.h Wed May 17 19:34:36 2017 (r318413) +++ vendor/llvm/dist/include/llvm/ADT/SmallPtrSet.h Wed May 17 20:22:39 2017 (r318414) @@ -27,15 +27,13 @@ #include #include -#if LLVM_ENABLE_ABI_BREAKING_CHECKS namespace llvm { + +#if LLVM_ENABLE_ABI_BREAKING_CHECKS template struct ReverseIterate { static bool value; }; template bool ReverseIterate::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 class SmallPtrSetIterator : public SmallPtrSetIteratorImpl { - typedef PointerLikeTypeTraits PtrTraits; + using PtrTraits = PointerLikeTypeTraits; 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 class SmallPtrSetImpl : public SmallPtrSetImplBase { using ConstPtrType = typename add_const_past_pointer::type; - typedef PointerLikeTypeTraits PtrTraits; - typedef PointerLikeTypeTraits ConstPtrTraits; + using PtrTraits = PointerLikeTypeTraits; + using ConstPtrTraits = PointerLikeTypeTraits; protected: // Constructors that forward to the base. @@ -365,8 +363,8 @@ protected: : SmallPtrSetImplBase(SmallStorage, SmallSize) {} public: - typedef SmallPtrSetIterator iterator; - typedef SmallPtrSetIterator const_iterator; + using iterator = SmallPtrSetIterator; + using const_iterator = SmallPtrSetIterator; 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 BaseT; + using BaseT = SmallPtrSetImpl; // Make sure that SmallSize is a power of two, round up if not. enum { SmallSizePowTwo = RoundUpToPowerOfTwo::Val }; Modified: vendor/llvm/dist/include/llvm/ADT/SmallVector.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/SmallVector.h Wed May 17 19:34:36 2017 (r318413) +++ vendor/llvm/dist/include/llvm/ADT/SmallVector.h Wed May 17 20:22:39 2017 (r318414) @@ -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 U; + using U = AlignedCharArrayUnion; 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_reverse_iterator; - typedef std::reverse_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; + using reverse_iterator = std::reverse_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 class SmallVectorImpl : public SmallVectorTemplateBase::value> { - typedef SmallVectorTemplateBase::value > SuperClass; + using SuperClass = SmallVectorTemplateBase::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 Storage; public: - SmallVector() : SmallVectorImpl(N) { - } + SmallVector() : SmallVectorImpl(N) {} explicit SmallVector(size_t Size, const T &Value = T()) : SmallVectorImpl(N) { @@ -883,16 +882,16 @@ public: SmallVectorImpl::operator=(::std::move(RHS)); } - const SmallVector &operator=(SmallVector &&RHS) { - SmallVectorImpl::operator=(::std::move(RHS)); - return *this; - } - SmallVector(SmallVectorImpl &&RHS) : SmallVectorImpl(N) { if (!RHS.empty()) SmallVectorImpl::operator=(::std::move(RHS)); } + const SmallVector &operator=(SmallVector &&RHS) { + SmallVectorImpl::operator=(::std::move(RHS)); + return *this; + } + const SmallVector &operator=(SmallVectorImpl &&RHS) { SmallVectorImpl::operator=(::std::move(RHS)); return *this; Modified: vendor/llvm/dist/include/llvm/ADT/SparseBitVector.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/SparseBitVector.h Wed May 17 19:34:36 2017 (r318413) +++ vendor/llvm/dist/include/llvm/ADT/SparseBitVector.h Wed May 17 20:22:39 2017 (r318414) @@ -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 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 class SparseBitVector { - typedef std::list> ElementList; - typedef typename ElementList::iterator ElementListIter; - typedef typename ElementList::const_iterator ElementListConstIter; + using ElementList = std::list>; + using ElementListIter = typename ElementList::iterator; + using ElementListConstIter = typename ElementList::const_iterator; enum { BITWORD_SIZE = SparseBitVectorElement::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: vendor/llvm/dist/include/llvm/ADT/SparseMultiSet.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/SparseMultiSet.h Wed May 17 19:34:36 2017 (r318413) +++ vendor/llvm/dist/include/llvm/ADT/SparseMultiSet.h Wed May 17 20:22:39 2017 (r318414) @@ -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 DenseT; + using KeyT = typename KeyFunctorT::argument_type; + using DenseT = SmallVector; DenseT Dense; SparseT *Sparse = nullptr; unsigned Universe = 0; @@ -183,12 +183,12 @@ class SparseMultiSet { } public: - typedef ValueT value_type; - typedef ValueT &reference; - typedef const ValueT &const_reference; - typedef ValueT *pointer; - typedef const ValueT *const_pointer; - typedef unsigned size_type; + using value_type = ValueT; + using reference = ValueT &; + using const_reference = const ValueT &; + using pointer = ValueT *; + using const_pointer = const ValueT *; + using size_type = unsigned; SparseMultiSet() = default; SparseMultiSet(const SparseMultiSet &) = delete; @@ -227,7 +227,7 @@ public: unsigned SparseIdx; iterator_base(SMSPtrTy P, unsigned I, unsigned SI) - : SMS(P), Idx(I), SparseIdx(SI) { } + : SMS(P), Idx(I), SparseIdx(SI) {} /// Whether our iterator has fallen outside our dense vector. bool isEnd() const { @@ -248,11 +248,11 @@ public: void setNext(unsigned N) { SMS->Dense[Idx].Next = N; } public: - typedef std::iterator super; - typedef typename super::value_type value_type; - typedef typename super::difference_type difference_type; - typedef typename super::pointer pointer; - typedef typename super::reference reference; + using super = std::iterator; + using value_type = typename super::value_type; + using difference_type = typename super::difference_type; + using pointer = typename super::pointer; + using reference = typename super::reference; reference operator*() const { assert(isKeyed() && SMS->sparseIndex(SMS->Dense[Idx].Data) == SparseIdx && @@ -308,11 +308,12 @@ public: return I; } }; - typedef iterator_base iterator; - typedef iterator_base const_iterator; + + using iterator = iterator_base; + using const_iterator = iterator_base; // Convenience types - typedef std::pair RangePair; + using RangePair = std::pair; /// Returns an iterator past this container. Note that such an iterator cannot /// be decremented, but will compare equal to other end iterators. Modified: vendor/llvm/dist/include/llvm/ADT/SparseSet.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/SparseSet.h Wed May 17 19:34:36 2017 (r318413) +++ vendor/llvm/dist/include/llvm/ADT/SparseSet.h Wed May 17 20:22:39 2017 (r318414) @@ -1,4 +1,4 @@ -//===--- llvm/ADT/SparseSet.h - Sparse set ----------------------*- C++ -*-===// +//===- llvm/ADT/SparseSet.h - Sparse set ------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -125,9 +125,9 @@ class SparseSet { !std::numeric_limits::is_signed, "SparseT must be an unsigned integer type"); - typedef typename KeyFunctorT::argument_type KeyT; - typedef SmallVector DenseT; - typedef unsigned size_type; + using KeyT = typename KeyFunctorT::argument_type; + using DenseT = SmallVector; + using size_type = unsigned; DenseT Dense; SparseT *Sparse = nullptr; unsigned Universe = 0; @@ -135,11 +135,11 @@ class SparseSet { SparseSetValFunctor ValIndexOf; public: - typedef ValueT value_type; - typedef ValueT &reference; - typedef const ValueT &const_reference; - typedef ValueT *pointer; - typedef const ValueT *const_pointer; + using value_type = ValueT; + using reference = ValueT &; + using const_reference = const ValueT &; + using pointer = ValueT *; + using const_pointer = const ValueT *; SparseSet() = default; SparseSet(const SparseSet &) = delete; @@ -168,8 +168,8 @@ public: } // Import trivial vector stuff from DenseT. - typedef typename DenseT::iterator iterator; - typedef typename DenseT::const_iterator const_iterator; + using iterator = typename DenseT::iterator; + using const_iterator = typename DenseT::const_iterator; const_iterator begin() const { return Dense.begin(); } const_iterator end() const { return Dense.end(); } Modified: vendor/llvm/dist/include/llvm/ADT/StringExtras.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/StringExtras.h Wed May 17 19:34:36 2017 (r318413) +++ vendor/llvm/dist/include/llvm/ADT/StringExtras.h Wed May 17 20:22:39 2017 (r318414) @@ -1,4 +1,4 @@ -//===-- llvm/ADT/StringExtras.h - Useful string functions -------*- C++ -*-===// +//===- llvm/ADT/StringExtras.h - Useful string functions --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -15,12 +15,18 @@ #define LLVM_ADT_STRINGEXTRAS_H #include "llvm/ADT/StringRef.h" -#include "llvm/Support/DataTypes.h" #include +#include +#include +#include +#include +#include +#include namespace llvm { -class raw_ostream; + template class SmallVectorImpl; +class raw_ostream; /// hexdigit - Return the hexadecimal character for the *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***