Improve swift::TransformRange enough to delete TransformArrayRef

We have a lot of "transform a range" types already:
llvm::mapped_iterator, swift::TransformRange and
swift::TransformIterator, and swift::ArrayRefView for static
transformations. This gets rid of one more layer without losing
any real functionality.
This commit is contained in:
Jordan Rose
2019-10-01 23:13:37 -07:00
parent a59f4385c9
commit 8b8c88e258
7 changed files with 54 additions and 160 deletions

View File

@@ -22,7 +22,6 @@
#include "swift/Basic/LLVM.h"
#include "swift/Basic/STLExtras.h"
#include "swift/Basic/TransformArrayRef.h"
namespace swift {
@@ -31,10 +30,11 @@ class SILPhiArgument;
class SILFunctionArgument;
using PhiArgumentArrayRef =
TransformArrayRef<function_ref<SILPhiArgument *(SILArgument *)>>;
TransformRange<ArrayRef<SILArgument *>, SILPhiArgument *(*)(SILArgument *)>;
using FunctionArgumentArrayRef =
TransformArrayRef<function_ref<SILFunctionArgument *(SILArgument *)>>;
TransformRange<ArrayRef<SILArgument *>,
SILFunctionArgument *(*)(SILArgument *)>;
} // namespace swift