summaryrefslogtreecommitdiffstats
path: root/lld/lib/Core
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2014-04-04 00:59:50 +0000
committerRui Ueyama <ruiu@google.com>2014-04-04 00:59:50 +0000
commit7cac0f784c3d19d59a4563bea2fea50963c5f44d (patch)
tree4336fc5328515c45b16abaa7905c7c46d9720a30 /lld/lib/Core
parent0b8e053ebd81dd67fcb96abf497804c8cd50b9c9 (diff)
downloadbcm5719-llvm-7cac0f784c3d19d59a4563bea2fea50963c5f44d.tar.gz
bcm5719-llvm-7cac0f784c3d19d59a4563bea2fea50963c5f44d.zip
Use range-based for loop. No functionality change.
llvm-svn: 205594
Diffstat (limited to 'lld/lib/Core')
-rw-r--r--lld/lib/Core/InputGraph.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/lld/lib/Core/InputGraph.cpp b/lld/lib/Core/InputGraph.cpp
index 39d2b193b7c..efb9481f981 100644
--- a/lld/lib/Core/InputGraph.cpp
+++ b/lld/lib/Core/InputGraph.cpp
@@ -75,24 +75,17 @@ ErrorOr<InputElement *> InputGraph::getNextInputElement() {
}
void InputGraph::normalize() {
- auto iterb = _inputArgs.begin();
- auto itere = _inputArgs.end();
- auto currentIter = _inputArgs.begin();
-
- std::vector<std::unique_ptr<InputElement> > _workInputArgs;
- while (iterb != itere) {
- bool expand = (*iterb)->shouldExpand();
- currentIter = iterb++;
- if (expand) {
- _workInputArgs.insert(
- _workInputArgs.end(),
- std::make_move_iterator((*currentIter)->expandElements().begin()),
- std::make_move_iterator((*currentIter)->expandElements().end()));
- } else {
- _workInputArgs.push_back(std::move(*currentIter));
+ std::vector<std::unique_ptr<InputElement>> vec;
+ for (std::unique_ptr<InputElement> &ie : _inputArgs) {
+ if (!ie->shouldExpand()) {
+ vec.push_back(std::move(ie));
+ continue;
}
+ range<InputElementIterT> expanded = ie->expandElements();
+ vec.insert(vec.end(), std::make_move_iterator(expanded.begin()),
+ std::make_move_iterator(expanded.end()));
}
- _inputArgs = std::move(_workInputArgs);
+ _inputArgs = std::move(vec);
}
/// \brief Read the file into _buffer.
OpenPOWER on IntegriCloud