r204062 - [C++11] Replacing CallArgList writeback iterators with iterator_range writebacks(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions.
Aaron Ballman
aaron at aaronballman.com
Mon Mar 17 10:22:28 PDT 2014
Author: aaronballman
Date: Mon Mar 17 12:22:27 2014
New Revision: 204062
URL: http://llvm.org/viewvc/llvm-project?rev=204062&view=rev
Log:
[C++11] Replacing CallArgList writeback iterators with iterator_range writebacks(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions.
Modified:
cfe/trunk/lib/CodeGen/CGCall.cpp
cfe/trunk/lib/CodeGen/CGCall.h
Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=204062&r1=204061&r2=204062&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Mon Mar 17 12:22:27 2014
@@ -2015,9 +2015,8 @@ static void emitWriteback(CodeGenFunctio
static void emitWritebacks(CodeGenFunction &CGF,
const CallArgList &args) {
- for (CallArgList::writeback_iterator
- i = args.writeback_begin(), e = args.writeback_end(); i != e; ++i)
- emitWriteback(CGF, *i);
+ for (const auto &I : args.writebacks())
+ emitWriteback(CGF, I);
}
static void deactivateArgCleanupsBeforeCall(CodeGenFunction &CGF,
Modified: cfe/trunk/lib/CodeGen/CGCall.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.h?rev=204062&r1=204061&r2=204062&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.h (original)
+++ cfe/trunk/lib/CodeGen/CGCall.h Mon Mar 17 12:22:27 2014
@@ -99,9 +99,12 @@ namespace CodeGen {
bool hasWritebacks() const { return !Writebacks.empty(); }
- typedef SmallVectorImpl<Writeback>::const_iterator writeback_iterator;
- writeback_iterator writeback_begin() const { return Writebacks.begin(); }
- writeback_iterator writeback_end() const { return Writebacks.end(); }
+ typedef llvm::iterator_range<SmallVectorImpl<Writeback>::const_iterator>
+ writeback_const_range;
+
+ writeback_const_range writebacks() const {
+ return writeback_const_range(Writebacks.begin(), Writebacks.end());
+ }
void addArgCleanupDeactivation(EHScopeStack::stable_iterator Cleanup,
llvm::Instruction *IsActiveIP) {
More information about the cfe-commits
mailing list