diff options
| author | Pete Cooper <peter_cooper@apple.com> | 2015-07-29 22:19:09 +0000 |
|---|---|---|
| committer | Pete Cooper <peter_cooper@apple.com> | 2015-07-29 22:19:09 +0000 |
| commit | f3159f3c120ce4dbe02077f7a9e9b6bf1daa35c0 (patch) | |
| tree | a34b9732f34aed4eafa8b137a25db486c941ee33 /llvm/lib/CodeGen/AsmPrinter | |
| parent | abb5a35d05fc0d513e3ac7be1571ceaddb5b191d (diff) | |
| download | bcm5719-llvm-f3159f3c120ce4dbe02077f7a9e9b6bf1daa35c0.tar.gz bcm5719-llvm-f3159f3c120ce4dbe02077f7a9e9b6bf1daa35c0.zip | |
Reapply "Add reverse(ContainerTy) range adapter."
This reverts commit r243567, which ultimately reapplies r243563.
The fix here was to use std::enable_if for overload resolution. Thanks to David
Blaikie for lots of help on this, and for the extra tests!
Original commit message follows:
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: 243581
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/ARMException.cpp | 3 |
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); |

