summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2015-07-29 20:00:39 +0000
committerPete Cooper <peter_cooper@apple.com>2015-07-29 20:00:39 +0000
commit9f1f7ad458d4a23132707f3e6e419d7e82b9d33b (patch)
tree50857dfed46ff8dfd1a2940add79639c58e1fa2d /llvm/lib
parent869a5ff37fe76de8f8d519655a9fd313d30ab02d (diff)
downloadbcm5719-llvm-9f1f7ad458d4a23132707f3e6e419d7e82b9d33b.tar.gz
bcm5719-llvm-9f1f7ad458d4a23132707f3e6e419d7e82b9d33b.zip
Add reverse(ContainerTy) range adapter.
For cases where we needed a foreach loop in reverse over a container, we had to do something like for (const GlobalValue *GV : make_range(TypeInfos.rbegin(), TypeInfos.rend())) { This provides a convenience method which shortens this to for (const GlobalValue *GV : reverse(TypeInfos)) { There are 2 versions of this, with a preference to the rbegin() version. The first uses rbegin() and rend() to construct an iterator_range. The second constructs an iterator_range from the begin() and end() methods wrapped in std::reverse_iterator's. Reviewed by David Blaikie. llvm-svn: 243563
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/ARMException.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp b/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
index 5f91763f27b..462e5d19c8d 100644
--- a/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
@@ -115,8 +115,7 @@ void ARMException::emitTypeInfos(unsigned TTypeEncoding) {
Entry = TypeInfos.size();
}
- for (const GlobalValue *GV : make_range(TypeInfos.rbegin(),
- TypeInfos.rend())) {
+ for (const GlobalValue *GV : reverse(TypeInfos)) {
if (VerboseAsm)
Asm->OutStreamer->AddComment("TypeInfo " + Twine(Entry--));
Asm->EmitTTypeReference(GV, TTypeEncoding);
OpenPOWER on IntegriCloud