Expand 'auto' that's hard for human to deduce its real type.

llvm-svn: 205564
This commit is contained in:
Rui Ueyama 2014-04-03 20:47:50 +00:00
parent 4dca4d8bbd
commit 69fcde8b0a
7 changed files with 12 additions and 12 deletions

View File

@ -176,13 +176,13 @@ public:
_madeProgress = false;
_currentElementIndex = 0;
_nextElementIndex = 0;
for (auto &elem : _elements)
for (std::unique_ptr<InputElement> &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<InputElement> &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<InputElement> &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<File> &ai : files)
_files.push_back(std::move(ai));
}

View File

@ -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);
}

View File

@ -50,7 +50,7 @@ bool InputGraph::addInputElement(std::unique_ptr<InputElement> ie) {
}
bool InputGraph::dump(raw_ostream &diagnostics) {
for (auto &ie : _inputArgs)
for (std::unique_ptr<InputElement> &ie : _inputArgs)
if (!ie->dump(diagnostics))
return false;
return true;

View File

@ -16,7 +16,7 @@
namespace lld {
error_code PassManager::runOnFile(std::unique_ptr<MutableFile> &mf) {
for (auto &pass : _passes)
for (std::unique_ptr<Pass> &pass : _passes)
pass->perform(mf);
return error_code::success();
}

View File

@ -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<InputElement> &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

View File

@ -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<script::Group>(c)) {
std::unique_ptr<Group> 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(

View File

@ -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<InputGraph>(new InputGraph()));
for (auto &file : files) {
for (std::unique_ptr<FileNode> &file : files) {
if (isReadingDirectiveSection)
if (file->parse(ctx, diag))
return false;