summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-04-05 16:07:44 +0000
committerRui Ueyama <ruiu@google.com>2017-04-05 16:07:44 +0000
commit92a5ba6da5233e4afcac450c6f69aab84c0ff1b7 (patch)
treeb701002cd5f65f6bc153c460e8bd5106c6482588 /lld/ELF/LinkerScript.cpp
parent9c766d7a397b652b5a04c6acff16b1473a3c8838 (diff)
downloadbcm5719-llvm-92a5ba6da5233e4afcac450c6f69aab84c0ff1b7.tar.gz
bcm5719-llvm-92a5ba6da5233e4afcac450c6f69aab84c0ff1b7.zip
Remove unnecessary local variable.
This patch does what r299506 was trying to do in a different way. llvm-svn: 299554
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r--lld/ELF/LinkerScript.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 924a0f370e7..9e39a5de32e 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -354,17 +354,14 @@ void LinkerScript::processCommands(OutputSectionFactory &Factory) {
CurOutSec = Aether;
Dot = 0;
- for (unsigned I = 0; I < Opt.Commands.size(); ++I) {
- auto Iter = Opt.Commands.begin() + I;
- BaseCommand *Base1 = *Iter;
-
+ for (size_t I = 0; I < Opt.Commands.size(); ++I) {
// Handle symbol assignments outside of any output section.
- if (auto *Cmd = dyn_cast<SymbolAssignment>(Base1)) {
+ if (auto *Cmd = dyn_cast<SymbolAssignment>(Opt.Commands[I])) {
addSymbol(Cmd);
continue;
}
- if (auto *Cmd = dyn_cast<OutputSectionCommand>(Base1)) {
+ if (auto *Cmd = dyn_cast<OutputSectionCommand>(Opt.Commands[I])) {
std::vector<InputSectionBase *> V = createInputSectionList(*Cmd);
// The output section name `/DISCARD/' is special.
@@ -384,7 +381,7 @@ void LinkerScript::processCommands(OutputSectionFactory &Factory) {
if (!matchConstraints(V, Cmd->Constraint)) {
for (InputSectionBase *S : V)
S->Assigned = false;
- Opt.Commands.erase(Iter);
+ Opt.Commands.erase(Opt.Commands.begin() + I);
--I;
continue;
}
OpenPOWER on IntegriCloud