From 69fcde8b0acb7ca46c057c4df00ffbfd7ad0d1cf Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 3 Apr 2014 20:47:50 +0000 Subject: [PATCH] Expand 'auto' that's hard for human to deduce its real type. llvm-svn: 205564 --- lld/include/lld/Core/InputGraph.h | 8 ++++---- lld/include/lld/ReaderWriter/LinkerScript.h | 4 ++-- lld/lib/Core/InputGraph.cpp | 2 +- lld/lib/Core/PassManager.cpp | 2 +- lld/lib/Driver/Driver.cpp | 2 +- lld/lib/Driver/GnuLdInputGraph.cpp | 4 ++-- lld/lib/Driver/WinLinkDriver.cpp | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lld/include/lld/Core/InputGraph.h b/lld/include/lld/Core/InputGraph.h index a2af630ad085..42e703a017cd 100644 --- a/lld/include/lld/Core/InputGraph.h +++ b/lld/include/lld/Core/InputGraph.h @@ -176,13 +176,13 @@ public: _madeProgress = false; _currentElementIndex = 0; _nextElementIndex = 0; - for (auto &elem : _elements) + for (std::unique_ptr &elem : _elements) elem->resetNextIndex(); } /// \brief Parse the group members. error_code parse(const LinkingContext &ctx, raw_ostream &diag) override { - for (auto &ei : _elements) + for (std::unique_ptr &ei : _elements) if (error_code ec = ei->parse(ctx, diag)) return ec; return error_code::success(); @@ -191,7 +191,7 @@ public: /// If Resolver made a progress using the current file, it's ok to revisit /// files in this group in future. void notifyProgress() override { - for (auto &elem : _elements) + for (std::unique_ptr &elem : _elements) elem->notifyProgress(); _madeProgress = true; } @@ -245,7 +245,7 @@ public: /// \brief add a file to the list of files virtual void addFiles(InputGraph::FileVectorT files) { - for (auto &ai : files) + for (std::unique_ptr &ai : files) _files.push_back(std::move(ai)); } diff --git a/lld/include/lld/ReaderWriter/LinkerScript.h b/lld/include/lld/ReaderWriter/LinkerScript.h index fc38f68c386c..bc9576b0b6be 100644 --- a/lld/include/lld/ReaderWriter/LinkerScript.h +++ b/lld/include/lld/ReaderWriter/LinkerScript.h @@ -165,7 +165,7 @@ public: void dump(raw_ostream &os) const override { os << "GROUP("; bool first = true; - for (const auto &path : getPaths()) { + for (const Path &path : getPaths()) { if (!first) os << " "; else @@ -209,7 +209,7 @@ private: class LinkerScript { public: void dump(raw_ostream &os) const { - for (const auto &c : _commands) + for (const Command *c : _commands) c->dump(os); } diff --git a/lld/lib/Core/InputGraph.cpp b/lld/lib/Core/InputGraph.cpp index 047e1c8a9453..730a958158ea 100644 --- a/lld/lib/Core/InputGraph.cpp +++ b/lld/lib/Core/InputGraph.cpp @@ -50,7 +50,7 @@ bool InputGraph::addInputElement(std::unique_ptr ie) { } bool InputGraph::dump(raw_ostream &diagnostics) { - for (auto &ie : _inputArgs) + for (std::unique_ptr &ie : _inputArgs) if (!ie->dump(diagnostics)) return false; return true; diff --git a/lld/lib/Core/PassManager.cpp b/lld/lib/Core/PassManager.cpp index 443a60930165..c46146122a0b 100644 --- a/lld/lib/Core/PassManager.cpp +++ b/lld/lib/Core/PassManager.cpp @@ -16,7 +16,7 @@ namespace lld { error_code PassManager::runOnFile(std::unique_ptr &mf) { - for (auto &pass : _passes) + for (std::unique_ptr &pass : _passes) pass->perform(mf); return error_code::success(); } diff --git a/lld/lib/Driver/Driver.cpp b/lld/lib/Driver/Driver.cpp index 11ae9e90d5d2..0e05725f1e7e 100644 --- a/lld/lib/Driver/Driver.cpp +++ b/lld/lib/Driver/Driver.cpp @@ -54,7 +54,7 @@ bool Driver::link(LinkingContext &context, raw_ostream &diagnostics) { ScopedTask readTask(getDefaultDomain(), "Read Args"); TaskGroup tg; std::mutex diagnosticsMutex; - for (auto &ie : inputGraph.inputElements()) { + for (std::unique_ptr &ie : inputGraph.inputElements()) { tg.spawn([&] { // Writes to the same output stream is not guaranteed to be thread-safe. // We buffer the diagnostics output to a separate string-backed output diff --git a/lld/lib/Driver/GnuLdInputGraph.cpp b/lld/lib/Driver/GnuLdInputGraph.cpp index eb592e0de47b..f650c465fee8 100644 --- a/lld/lib/Driver/GnuLdInputGraph.cpp +++ b/lld/lib/Driver/GnuLdInputGraph.cpp @@ -77,10 +77,10 @@ error_code ELFGNULdScript::parse(const LinkingContext &ctx, ELFFileNode::Attributes attributes; if (error_code ec = GNULdScript::parse(ctx, diagnostics)) return ec; - for (const auto &c : _linkerScript->_commands) { + for (const script::Command *c : _linkerScript->_commands) { if (auto group = dyn_cast(c)) { std::unique_ptr groupStart(new Group()); - for (auto &path : group->getPaths()) { + for (const script::Path &path : group->getPaths()) { // TODO : Propagate Set WholeArchive/dashlPrefix attributes.setAsNeeded(path._asNeeded); auto inputNode = new ELFFileNode( diff --git a/lld/lib/Driver/WinLinkDriver.cpp b/lld/lib/Driver/WinLinkDriver.cpp index 6a31aa95a6ed..2ab1a7f6a94a 100644 --- a/lld/lib/Driver/WinLinkDriver.cpp +++ b/lld/lib/Driver/WinLinkDriver.cpp @@ -1237,7 +1237,7 @@ bool WinLinkDriver::parse(int argc, const char *argv[], // Add the input files to the input graph. if (!ctx.hasInputGraph()) ctx.setInputGraph(std::unique_ptr(new InputGraph())); - for (auto &file : files) { + for (std::unique_ptr &file : files) { if (isReadingDirectiveSection) if (file->parse(ctx, diag)) return false;