From 7b0d08196544b59083874e8bc92fe37756b9b925 Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Tue, 8 Oct 2019 11:21:49 -0700 Subject: [PATCH 1/2] Remove IteratorRange in favor of llvm::iterator_range Now that llvm::iterator_range has 'empty', there's not enough reason to keep our own version of it in the Swift repo. No functionality change. --- include/swift/AST/DeclContext.h | 2 +- include/swift/AST/Types.h | 13 +++--- include/swift/Basic/STLExtras.h | 30 ++----------- include/swift/SIL/SILFunctionConventions.h | 45 +++++++------------ .../SILOptimizer/Analysis/ClosureScope.h | 2 +- .../Analysis/LoopRegionAnalysis.h | 2 +- .../swift/SILOptimizer/Utils/InstOptUtils.h | 5 +-- lib/FrontendTool/ImportedModules.cpp | 3 +- lib/SIL/SILVerifier.cpp | 5 ++- 9 files changed, 32 insertions(+), 75 deletions(-) diff --git a/include/swift/AST/DeclContext.h b/include/swift/AST/DeclContext.h index b1dfee05148b5..1c1d1e165d0fa 100644 --- a/include/swift/AST/DeclContext.h +++ b/include/swift/AST/DeclContext.h @@ -667,7 +667,7 @@ class DeclIterator { /// The range of declarations stored within an iterable declaration /// context. -typedef IteratorRange DeclRange; +typedef llvm::iterator_range DeclRange; /// The kind of an \c IterableDeclContext. enum class IterableDeclContextKind : uint8_t { diff --git a/include/swift/AST/Types.h b/include/swift/AST/Types.h index 7e1dad7294e27..f5a2ff5a40a20 100644 --- a/include/swift/AST/Types.h +++ b/include/swift/AST/Types.h @@ -3965,13 +3965,12 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode, }; using IndirectFormalResultIter = llvm::filter_iterator; - using IndirectFormalResultRange = IteratorRange; + using IndirectFormalResultRange = + llvm::iterator_range; /// A range of SILResultInfo for all formally indirect results. IndirectFormalResultRange getIndirectFormalResults() const { - auto filter = - llvm::make_filter_range(getResults(), IndirectFormalResultFilter()); - return makeIteratorRange(filter.begin(), filter.end()); + return llvm::make_filter_range(getResults(), IndirectFormalResultFilter()); } struct DirectFormalResultFilter { @@ -3981,13 +3980,11 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode, }; using DirectFormalResultIter = llvm::filter_iterator; - using DirectFormalResultRange = IteratorRange; + using DirectFormalResultRange = llvm::iterator_range; /// A range of SILResultInfo for all formally direct results. DirectFormalResultRange getDirectFormalResults() const { - auto filter = - llvm::make_filter_range(getResults(), DirectFormalResultFilter()); - return makeIteratorRange(filter.begin(), filter.end()); + return llvm::make_filter_range(getResults(), DirectFormalResultFilter()); } /// Get a single non-address SILType that represents all formal direct diff --git a/include/swift/Basic/STLExtras.h b/include/swift/Basic/STLExtras.h index 231737fecaf5d..5c143c1b6f397 100644 --- a/include/swift/Basic/STLExtras.h +++ b/include/swift/Basic/STLExtras.h @@ -251,37 +251,13 @@ inline Iterator prev_or_begin(Iterator it, Iterator begin) { /// @} -/// A range of iterators. -/// TODO: Add `llvm::iterator_range::empty()`, then remove this helper, along -/// with the superfluous TransformIterator. -template -class IteratorRange { - Iterator First, Last; - -public: - using iterator = Iterator; - - IteratorRange(Iterator first, Iterator last) : First(first), Last(last) { } - iterator begin() const { return First; } - iterator end() const { return Last; } - bool empty() const { return First == Last; } - - typename std::iterator_traits::value_type front() const { - assert(!empty() && "Front of empty range"); - return *begin(); - } -}; - -/// Create a new iterator range. -template -inline IteratorRange -makeIteratorRange(Iterator first, Iterator last) { - return IteratorRange(first, last); -} /// An iterator that transforms the result of an underlying bidirectional /// iterator with a given operation. /// +/// Slightly different semantics from llvm::map_iterator, but we should +/// probably figure out how to merge them eventually. +/// /// \tparam Iterator the underlying iterator. /// /// \tparam Operation A function object that transforms the underlying diff --git a/include/swift/SIL/SILFunctionConventions.h b/include/swift/SIL/SILFunctionConventions.h index 92713b0a962a1..9e428f2099534 100644 --- a/include/swift/SIL/SILFunctionConventions.h +++ b/include/swift/SIL/SILFunctionConventions.h @@ -193,10 +193,9 @@ class SILFunctionConventions { if (silConv.loweredAddresses) return funcTy->getIndirectFormalResults(); - auto filter = llvm::make_filter_range( - makeIteratorRange((const SILResultInfo *)0, (const SILResultInfo *)0), + return llvm::make_filter_range( + llvm::make_range((const SILResultInfo *)0, (const SILResultInfo *)0), SILFunctionType::IndirectFormalResultFilter()); - return makeIteratorRange(filter.begin(), filter.end()); } struct SILResultTypeFunc { @@ -210,16 +209,13 @@ class SILFunctionConventions { using IndirectSILResultTypeIter = llvm::mapped_iterator; - using IndirectSILResultTypeRange = IteratorRange; + using IndirectSILResultTypeRange = + llvm::iterator_range; /// Return a range of SILTypes for each result passed as an address-typed SIL /// argument. IndirectSILResultTypeRange getIndirectSILResultTypes() const { - return makeIteratorRange( - IndirectSILResultTypeIter(getIndirectSILResults().begin(), - SILResultTypeFunc(silConv)), - IndirectSILResultTypeIter(getIndirectSILResults().end(), - SILResultTypeFunc(silConv))); + return llvm::map_range(getIndirectSILResults(), SILResultTypeFunc(silConv)); } /// Get the number of SIL results directly returned by SIL value. @@ -238,28 +234,24 @@ class SILFunctionConventions { }; using DirectSILResultIter = llvm::filter_iterator; - using DirectSILResultRange = IteratorRange; + using DirectSILResultRange = llvm::iterator_range; /// Return a range of direct result information for results directly returned /// by SIL value. DirectSILResultRange getDirectSILResults() const { - auto filter = llvm::make_filter_range( + return llvm::make_filter_range( funcTy->getResults(), DirectSILResultFilter(silConv.loweredAddresses)); - return makeIteratorRange(filter.begin(), filter.end()); } using DirectSILResultTypeIter = llvm::mapped_iterator; - using DirectSILResultTypeRange = IteratorRange; + using DirectSILResultTypeRange = + llvm::iterator_range; /// Return a range of SILTypes for each result directly returned /// by SIL value. DirectSILResultTypeRange getDirectSILResultTypes() const { - return makeIteratorRange( - DirectSILResultTypeIter(getDirectSILResults().begin(), - SILResultTypeFunc(silConv)), - DirectSILResultTypeIter(getDirectSILResults().end(), - SILResultTypeFunc(silConv))); + return llvm::map_range(getDirectSILResults(), SILResultTypeFunc(silConv)); } //===--------------------------------------------------------------------===// @@ -288,16 +280,13 @@ class SILFunctionConventions { using SILParameterTypeIter = llvm::mapped_iterator; - using SILParameterTypeRange = IteratorRange; + using SILParameterTypeRange = llvm::iterator_range; /// Return a range of SILTypes for each function parameter, not including /// indirect results. SILParameterTypeRange getParameterSILTypes() const { - return makeIteratorRange( - SILParameterTypeIter(funcTy->getParameters().begin(), - SILParameterTypeFunc(silConv)), - SILParameterTypeIter(funcTy->getParameters().end(), - SILParameterTypeFunc(silConv))); + return llvm::map_range(funcTy->getParameters(), + SILParameterTypeFunc(silConv)); } //===--------------------------------------------------------------------===// @@ -312,14 +301,10 @@ class SILFunctionConventions { using SILYieldTypeIter = llvm::mapped_iterator; - using SILYieldTypeRange = IteratorRange; + using SILYieldTypeRange = llvm::iterator_range; SILYieldTypeRange getYieldSILTypes() const { - return makeIteratorRange( - SILYieldTypeIter(funcTy->getYields().begin(), - SILParameterTypeFunc(silConv)), - SILYieldTypeIter(funcTy->getYields().end(), - SILParameterTypeFunc(silConv))); + return llvm::map_range(funcTy->getYields(), SILParameterTypeFunc(silConv)); } SILYieldInfo getYieldInfoForOperandIndex(unsigned opIndex) const { diff --git a/include/swift/SILOptimizer/Analysis/ClosureScope.h b/include/swift/SILOptimizer/Analysis/ClosureScope.h index b7855799136bf..565d5cf065dd3 100644 --- a/include/swift/SILOptimizer/Analysis/ClosureScope.h +++ b/include/swift/SILOptimizer/Analysis/ClosureScope.h @@ -102,7 +102,7 @@ class ClosureScopeAnalysis : public SILAnalysis { return None; } }; - using IndexRange = IteratorRange; + using IndexRange = llvm::iterator_range; public: // A range of SILFunction scopes converted from their scope indices and diff --git a/include/swift/SILOptimizer/Analysis/LoopRegionAnalysis.h b/include/swift/SILOptimizer/Analysis/LoopRegionAnalysis.h index c3682a33f01c2..326f7cc9792bc 100644 --- a/include/swift/SILOptimizer/Analysis/LoopRegionAnalysis.h +++ b/include/swift/SILOptimizer/Analysis/LoopRegionAnalysis.h @@ -674,7 +674,7 @@ class LoopRegion { unsigned succ_size() const { return Succs.size(); } private: - using InnerSuccRange = IteratorRange; + using InnerSuccRange = llvm::iterator_range; public: using SuccRange = diff --git a/include/swift/SILOptimizer/Utils/InstOptUtils.h b/include/swift/SILOptimizer/Utils/InstOptUtils.h index 15c5f82089dc7..fa64f3d5df5c2 100644 --- a/include/swift/SILOptimizer/Utils/InstOptUtils.h +++ b/include/swift/SILOptimizer/Utils/InstOptUtils.h @@ -38,13 +38,12 @@ template class NullablePtr; /// Transform a Use Range (Operand*) into a User Range (SILInstruction*) using UserTransform = std::function; using ValueBaseUserRange = - TransformRange, UserTransform>; + TransformRange,UserTransform>; inline ValueBaseUserRange makeUserRange(iterator_range range) { auto toUser = [](Operand *operand) { return operand->getUser(); }; - return makeTransformRange(makeIteratorRange(range.begin(), range.end()), - UserTransform(toUser)); + return makeTransformRange(range, UserTransform(toUser)); } using DeadInstructionSet = llvm::SmallSetVector; diff --git a/lib/FrontendTool/ImportedModules.cpp b/lib/FrontendTool/ImportedModules.cpp index 82e3e7ddcb97b..5b9837f424f99 100644 --- a/lib/FrontendTool/ImportedModules.cpp +++ b/lib/FrontendTool/ImportedModules.cpp @@ -37,8 +37,7 @@ static void findAllClangImports(const clang::Module *module, modules.insert(getTopLevelName(imported)); } - for (auto sub : - makeIteratorRange(module->submodule_begin(), module->submodule_end())) { + for (auto sub : module->submodules()) { findAllClangImports(sub, modules); } } diff --git a/lib/SIL/SILVerifier.cpp b/lib/SIL/SILVerifier.cpp index 9c6f9d4a1dd93..03d11540f459c 100644 --- a/lib/SIL/SILVerifier.cpp +++ b/lib/SIL/SILVerifier.cpp @@ -2027,13 +2027,14 @@ class SILVerifier : public SILVerifierBase { require(initConv.getNumDirectSILResults() == 1, "wrong number of init function results"); require(Dest->getType().getObjectType() == - initConv.getDirectSILResultTypes().front(), + *initConv.getDirectSILResultTypes().begin(), "wrong init function result type"); break; case 1: require(initConv.getNumDirectSILResults() == 0, "wrong number of init function results"); - require(Dest->getType() == initConv.getIndirectSILResultTypes().front(), + require(Dest->getType() == + *initConv.getIndirectSILResultTypes().begin(), "wrong indirect init function result type"); break; default: From a1ea211f22ad27a2ddc83ec1c3a24e1a18991d16 Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Tue, 8 Oct 2019 15:23:02 -0700 Subject: [PATCH 2/2] Add llvm::iterator_range to LLVM.h If we're going to get rid of swift::IteratorRange, let's make llvm::iterator_range easy to use. No functionality change. --- include/swift/AST/Attr.h | 2 +- include/swift/AST/DeclContext.h | 2 +- include/swift/AST/Types.h | 5 ++--- include/swift/Basic/BlotSetVector.h | 4 ++-- include/swift/Basic/LLVM.h | 2 ++ include/swift/Basic/Range.h | 1 - include/swift/SIL/Notifications.h | 2 +- include/swift/SIL/SILFunctionConventions.h | 12 +++++------- include/swift/SIL/SILInstruction.h | 6 +++--- include/swift/SIL/SILValue.h | 2 +- include/swift/SILOptimizer/Analysis/ClosureScope.h | 2 +- .../swift/SILOptimizer/Analysis/LoopRegionAnalysis.h | 8 ++++---- include/swift/SILOptimizer/Utils/InstOptUtils.h | 2 +- lib/PrintAsObjC/DeclAndTypePrinter.cpp | 2 +- lib/PrintAsObjC/DeclAndTypePrinter.h | 2 +- lib/SILOptimizer/Transforms/CopyPropagation.cpp | 2 +- 16 files changed, 27 insertions(+), 29 deletions(-) diff --git a/include/swift/AST/Attr.h b/include/swift/AST/Attr.h index 2300fceed18cc..42ada178624aa 100644 --- a/include/swift/AST/Attr.h +++ b/include/swift/AST/Attr.h @@ -1672,7 +1672,7 @@ class DeclAttributes { public: template using AttributeKindRange = - OptionalTransformRange, + OptionalTransformRange, ToAttributeKind, const_iterator>; diff --git a/include/swift/AST/DeclContext.h b/include/swift/AST/DeclContext.h index 1c1d1e165d0fa..186a8aa463d05 100644 --- a/include/swift/AST/DeclContext.h +++ b/include/swift/AST/DeclContext.h @@ -667,7 +667,7 @@ class DeclIterator { /// The range of declarations stored within an iterable declaration /// context. -typedef llvm::iterator_range DeclRange; +using DeclRange = iterator_range; /// The kind of an \c IterableDeclContext. enum class IterableDeclContextKind : uint8_t { diff --git a/include/swift/AST/Types.h b/include/swift/AST/Types.h index f5a2ff5a40a20..7a7bef1cb1675 100644 --- a/include/swift/AST/Types.h +++ b/include/swift/AST/Types.h @@ -3965,8 +3965,7 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode, }; using IndirectFormalResultIter = llvm::filter_iterator; - using IndirectFormalResultRange = - llvm::iterator_range; + using IndirectFormalResultRange = iterator_range; /// A range of SILResultInfo for all formally indirect results. IndirectFormalResultRange getIndirectFormalResults() const { @@ -3980,7 +3979,7 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode, }; using DirectFormalResultIter = llvm::filter_iterator; - using DirectFormalResultRange = llvm::iterator_range; + using DirectFormalResultRange = iterator_range; /// A range of SILResultInfo for all formally direct results. DirectFormalResultRange getDirectFormalResults() const { diff --git a/include/swift/Basic/BlotSetVector.h b/include/swift/Basic/BlotSetVector.h index f6da1902a86f3..bf57c311c7929 100644 --- a/include/swift/Basic/BlotSetVector.h +++ b/include/swift/Basic/BlotSetVector.h @@ -67,14 +67,14 @@ class BlotSetVector { ArrayRef> getArray() const { return vector; } - llvm::iterator_range getRange() const { + iterator_range getRange() const { return {begin(), end()}; } using const_reverse_iterator = typename VectorT::const_reverse_iterator; const_reverse_iterator rbegin() const { return vector.rbegin(); } const_reverse_iterator rend() const { return vector.rend(); } - llvm::iterator_range getReverseRange() const { + iterator_range getReverseRange() const { return {rbegin(), rend()}; } diff --git a/include/swift/Basic/LLVM.h b/include/swift/Basic/LLVM.h index 3ce78f9e583da..e3876ae81d59c 100644 --- a/include/swift/Basic/LLVM.h +++ b/include/swift/Basic/LLVM.h @@ -43,6 +43,7 @@ namespace llvm { template class TinyPtrVector; template class Optional; template class PointerUnion; + template class iterator_range; class SmallBitVector; // Other common classes. @@ -63,6 +64,7 @@ namespace swift { // Containers. using llvm::ArrayRef; + using llvm::iterator_range; using llvm::MutableArrayRef; using llvm::None; using llvm::Optional; diff --git a/include/swift/Basic/Range.h b/include/swift/Basic/Range.h index 8f469418e694b..e79a95f195215 100644 --- a/include/swift/Basic/Range.h +++ b/include/swift/Basic/Range.h @@ -44,7 +44,6 @@ namespace swift { using llvm::make_range; - using llvm::iterator_range; template inline auto reversed(T &&container) diff --git a/include/swift/SIL/Notifications.h b/include/swift/SIL/Notifications.h index 6df8d36606b32..91ab29c2c5bff 100644 --- a/include/swift/SIL/Notifications.h +++ b/include/swift/SIL/Notifications.h @@ -194,7 +194,7 @@ class DeserializationNotificationHandlerSet final using iterator = llvm::mapped_iterator< decltype(handlerSet)::const_iterator, decltype(&DeserializationNotificationHandlerSet::getUnderlyingHandler)>; - using range = llvm::iterator_range; + using range = iterator_range; /// Returns an iterator to the first element of the handler set. /// diff --git a/include/swift/SIL/SILFunctionConventions.h b/include/swift/SIL/SILFunctionConventions.h index 9e428f2099534..b4014e418ab6e 100644 --- a/include/swift/SIL/SILFunctionConventions.h +++ b/include/swift/SIL/SILFunctionConventions.h @@ -209,8 +209,7 @@ class SILFunctionConventions { using IndirectSILResultTypeIter = llvm::mapped_iterator; - using IndirectSILResultTypeRange = - llvm::iterator_range; + using IndirectSILResultTypeRange = iterator_range; /// Return a range of SILTypes for each result passed as an address-typed SIL /// argument. @@ -234,7 +233,7 @@ class SILFunctionConventions { }; using DirectSILResultIter = llvm::filter_iterator; - using DirectSILResultRange = llvm::iterator_range; + using DirectSILResultRange = iterator_range; /// Return a range of direct result information for results directly returned /// by SIL value. @@ -245,8 +244,7 @@ class SILFunctionConventions { using DirectSILResultTypeIter = llvm::mapped_iterator; - using DirectSILResultTypeRange = - llvm::iterator_range; + using DirectSILResultTypeRange = iterator_range; /// Return a range of SILTypes for each result directly returned /// by SIL value. @@ -280,7 +278,7 @@ class SILFunctionConventions { using SILParameterTypeIter = llvm::mapped_iterator; - using SILParameterTypeRange = llvm::iterator_range; + using SILParameterTypeRange = iterator_range; /// Return a range of SILTypes for each function parameter, not including /// indirect results. @@ -301,7 +299,7 @@ class SILFunctionConventions { using SILYieldTypeIter = llvm::mapped_iterator; - using SILYieldTypeRange = llvm::iterator_range; + using SILYieldTypeRange = iterator_range; SILYieldTypeRange getYieldSILTypes() const { return llvm::map_range(funcTy->getYields(), SILParameterTypeFunc(silConv)); diff --git a/include/swift/SIL/SILInstruction.h b/include/swift/SIL/SILInstruction.h index 869977149a983..3aa4d6770bcad 100644 --- a/include/swift/SIL/SILInstruction.h +++ b/include/swift/SIL/SILInstruction.h @@ -168,12 +168,12 @@ class SILInstructionResultArray { reverse_iterator rbegin() const; reverse_iterator rend() const; - using range = llvm::iterator_range; + using range = iterator_range; range getValues() const; - using reverse_range = llvm::iterator_range; + using reverse_range = iterator_range; reverse_range getReversedValues() const; - using type_range = llvm::iterator_range< + using type_range = iterator_range< llvm::mapped_iterator>; type_range getTypes() const; diff --git a/include/swift/SIL/SILValue.h b/include/swift/SIL/SILValue.h index 03be26fabe537..1473444243bcd 100644 --- a/include/swift/SIL/SILValue.h +++ b/include/swift/SIL/SILValue.h @@ -281,7 +281,7 @@ class ValueBase : public SILNode, public SILAllocated { template using DowncastUserFilterRange = DowncastFilterRange>>; /// Iterate over the use list of this ValueBase visiting all users that are of diff --git a/include/swift/SILOptimizer/Analysis/ClosureScope.h b/include/swift/SILOptimizer/Analysis/ClosureScope.h index 565d5cf065dd3..7c428acd5c522 100644 --- a/include/swift/SILOptimizer/Analysis/ClosureScope.h +++ b/include/swift/SILOptimizer/Analysis/ClosureScope.h @@ -102,7 +102,7 @@ class ClosureScopeAnalysis : public SILAnalysis { return None; } }; - using IndexRange = llvm::iterator_range; + using IndexRange = iterator_range; public: // A range of SILFunction scopes converted from their scope indices and diff --git a/include/swift/SILOptimizer/Analysis/LoopRegionAnalysis.h b/include/swift/SILOptimizer/Analysis/LoopRegionAnalysis.h index 326f7cc9792bc..985b9cb362c27 100644 --- a/include/swift/SILOptimizer/Analysis/LoopRegionAnalysis.h +++ b/include/swift/SILOptimizer/Analysis/LoopRegionAnalysis.h @@ -591,11 +591,11 @@ class LoopRegion { return getSubregionData().rend(); } - llvm::iterator_range getSubregions() const { + iterator_range getSubregions() const { return {subregion_begin(), subregion_end()}; } - llvm::iterator_range + iterator_range getReverseSubregions() const { return {subregion_rbegin(), subregion_rend()}; } @@ -674,7 +674,7 @@ class LoopRegion { unsigned succ_size() const { return Succs.size(); } private: - using InnerSuccRange = llvm::iterator_range; + using InnerSuccRange = iterator_range; public: using SuccRange = @@ -964,7 +964,7 @@ class LoopRegionFunctionInfo { const_iterator end() const { return IDToRegionMap.end(); } unsigned size() const { return IDToRegionMap.size(); } bool empty() const { return IDToRegionMap.empty(); } - llvm::iterator_range getRegions() const { + iterator_range getRegions() const { return {begin(), end()}; } diff --git a/include/swift/SILOptimizer/Utils/InstOptUtils.h b/include/swift/SILOptimizer/Utils/InstOptUtils.h index fa64f3d5df5c2..5d1af19272d1a 100644 --- a/include/swift/SILOptimizer/Utils/InstOptUtils.h +++ b/include/swift/SILOptimizer/Utils/InstOptUtils.h @@ -38,7 +38,7 @@ template class NullablePtr; /// Transform a Use Range (Operand*) into a User Range (SILInstruction*) using UserTransform = std::function; using ValueBaseUserRange = - TransformRange,UserTransform>; + TransformRange, UserTransform>; inline ValueBaseUserRange makeUserRange(iterator_range range) { diff --git a/lib/PrintAsObjC/DeclAndTypePrinter.cpp b/lib/PrintAsObjC/DeclAndTypePrinter.cpp index 64fd30bd96c0b..c9a05d3b78801 100644 --- a/lib/PrintAsObjC/DeclAndTypePrinter.cpp +++ b/lib/PrintAsObjC/DeclAndTypePrinter.cpp @@ -2034,7 +2034,7 @@ void DeclAndTypePrinter::print(Type ty) { } void DeclAndTypePrinter::printAdHocCategory( - llvm::iterator_range members) { + iterator_range members) { getImpl().printAdHocCategory(members); } diff --git a/lib/PrintAsObjC/DeclAndTypePrinter.h b/lib/PrintAsObjC/DeclAndTypePrinter.h index fc7a51f137a19..61d159a98e502 100644 --- a/lib/PrintAsObjC/DeclAndTypePrinter.h +++ b/lib/PrintAsObjC/DeclAndTypePrinter.h @@ -74,7 +74,7 @@ class DeclAndTypePrinter { /// /// All members must have the same parent type. The list must not be empty. void - printAdHocCategory(llvm::iterator_range members); + printAdHocCategory(iterator_range members); /// Returns the name of an type minus the leading "OS_", /// or an empty string if \p decl is not an type. diff --git a/lib/SILOptimizer/Transforms/CopyPropagation.cpp b/lib/SILOptimizer/Transforms/CopyPropagation.cpp index 185e900052f82..52158b4c6abd7 100644 --- a/lib/SILOptimizer/Transforms/CopyPropagation.cpp +++ b/lib/SILOptimizer/Transforms/CopyPropagation.cpp @@ -419,7 +419,7 @@ class LivenessInfo { originalDestroyBlocks.insert(use->getUser()->getParent()); } - llvm::iterator_range + iterator_range getOriginalDestroyBlocks() const { return originalDestroyBlocks; }