summaryrefslogtreecommitdiffstats
path: root/lld
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2014-04-07 21:13:33 +0000
committerRui Ueyama <ruiu@google.com>2014-04-07 21:13:33 +0000
commite6c499acd71cd2732b34add467516be9a1760f08 (patch)
treea7e791880742f1aeca92b934299a9a9fa9a7c0d5 /lld
parent5de951d8c13fae2065de22cadfb0f4a94dbb7fe1 (diff)
downloadbcm5719-llvm-e6c499acd71cd2732b34add467516be9a1760f08.tar.gz
bcm5719-llvm-e6c499acd71cd2732b34add467516be9a1760f08.zip
Early continue to reduce nesting.
llvm-svn: 205737
Diffstat (limited to 'lld')
-rw-r--r--lld/lib/Driver/GnuLdInputGraph.cpp26
1 files changed, 13 insertions, 13 deletions
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<script::Group>(c)) {
- std::unique_ptr<Group> 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<InputElement> inputFile(inputNode);
- cast<Group>(groupStart.get())->addFile(
- std::move(inputFile));
- }
- _expandElements.push_back(std::move(groupStart));
+ auto *group = dyn_cast<script::Group>(c);
+ if (!group)
+ continue;
+ std::unique_ptr<Group> 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<InputElement> inputFile(inputNode);
+ cast<Group>(groupStart.get())->addFile(std::move(inputFile));
}
+ _expandElements.push_back(std::move(groupStart));
}
return error_code::success();
}
OpenPOWER on IntegriCloud