From e6c499acd71cd2732b34add467516be9a1760f08 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Mon, 7 Apr 2014 21:13:33 +0000 Subject: Early continue to reduce nesting. llvm-svn: 205737 --- lld/lib/Driver/GnuLdInputGraph.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'lld') diff --git a/lld/lib/Driver/GnuLdInputGraph.cpp b/lld/lib/Driver/GnuLdInputGraph.cpp index ca0ec371dcc..d07ef0742e0 100644 --- a/lld/lib/Driver/GnuLdInputGraph.cpp +++ b/lld/lib/Driver/GnuLdInputGraph.cpp @@ -77,20 +77,20 @@ error_code ELFGNULdScript::parse(const LinkingContext &ctx, if (error_code ec = GNULdScript::parse(ctx, diagnostics)) return ec; for (const script::Command *c : _linkerScript->_commands) { - if (auto group = dyn_cast(c)) { - std::unique_ptr groupStart(new Group()); - for (const script::Path &path : group->getPaths()) { - // TODO : Propagate Set WholeArchive/dashlPrefix - attributes.setAsNeeded(path._asNeeded); - auto inputNode = new ELFFileNode( - _elfLinkingContext, _elfLinkingContext.allocateString(path._path), - attributes); - std::unique_ptr inputFile(inputNode); - cast(groupStart.get())->addFile( - std::move(inputFile)); - } - _expandElements.push_back(std::move(groupStart)); + auto *group = dyn_cast(c); + if (!group) + continue; + std::unique_ptr groupStart(new Group()); + for (const script::Path &path : group->getPaths()) { + // TODO : Propagate Set WholeArchive/dashlPrefix + attributes.setAsNeeded(path._asNeeded); + auto inputNode = new ELFFileNode( + _elfLinkingContext, _elfLinkingContext.allocateString(path._path), + attributes); + std::unique_ptr inputFile(inputNode); + cast(groupStart.get())->addFile(std::move(inputFile)); } + _expandElements.push_back(std::move(groupStart)); } return error_code::success(); } -- cgit v1.2.3