diff options
| author | David Greene <greened@obbligato.org> | 2011-07-29 19:07:02 +0000 |
|---|---|---|
| committer | David Greene <greened@obbligato.org> | 2011-07-29 19:07:02 +0000 |
| commit | cdd64328c7a794c3229aba52e4b5a55cb8400adc (patch) | |
| tree | 5a224f40447abf16403bb79f4654ff00838050e7 /llvm/utils/TableGen/Record.cpp | |
| parent | b3da8123c0a440f4b7115ecbcef2ccb85e328b68 (diff) | |
| download | bcm5719-llvm-cdd64328c7a794c3229aba52e4b5a55cb8400adc.tar.gz bcm5719-llvm-cdd64328c7a794c3229aba52e4b5a55cb8400adc.zip | |
[AVX] Remove non-const Iterators
Remove all non-const iterators from Init classes. This is another
step toward constifying Inits and ultimately turning them into
FoldingSetNodes.
llvm-svn: 136484
Diffstat (limited to 'llvm/utils/TableGen/Record.cpp')
| -rw-r--r-- | llvm/utils/TableGen/Record.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/Record.cpp b/llvm/utils/TableGen/Record.cpp index e2ec81609a3..4f33638eaa7 100644 --- a/llvm/utils/TableGen/Record.cpp +++ b/llvm/utils/TableGen/Record.cpp @@ -673,7 +673,13 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) { assert(0 && "Empty list in cdr"); return 0; } - ListInit *Result = new ListInit(LHSl->begin()+1, LHSl->end(), + ListInit::const_iterator begin = LHSl->begin()+1; + ListInit::const_iterator end = LHSl->end(); + // We can't pass these iterators directly to ArrayRef because + // they are not convertible to Init **. Fortunately, + // RandomAccessIterator::operator * is guaranteed to return an + // lvalue. + ListInit *Result = new ListInit(ArrayRef<Init *>(&*begin, end - begin), LHSl->getType()); return Result; } @@ -920,7 +926,7 @@ static Init *ForeachHelper(Init *LHS, Init *MHS, Init *RHS, RecTy *Type, std::vector<Init *> NewOperands; std::vector<Init *> NewList(MHSl->begin(), MHSl->end()); - for (ListInit::iterator li = NewList.begin(), + for (std::vector<Init *>::iterator li = NewList.begin(), liend = NewList.end(); li != liend; ++li) { |

