From 1460e9f1ca07af1189971429eee76d7c0d086103 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Sat, 26 Mar 2016 18:33:09 +0000 Subject: [PATCH] [ELF/LTO] Refactor to reduce indentation. Suggested by: Rui Ueyama. llvm-svn: 264518 --- lld/ELF/LTO.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp index 7b1c31a..cbdd49a 100644 --- a/lld/ELF/LTO.cpp +++ b/lld/ELF/LTO.cpp @@ -82,22 +82,22 @@ void BitcodeCompiler::add(BitcodeFile &F) { Keep.push_back(GV); continue; } - if (!BitcodeFile::shouldSkip(Sym)) { - if (SymbolBody *B = Bodies[BodyIndex++]) - if (&B->repl() == B && isa(B)) { - switch (GV->getLinkage()) { - default: - break; - case llvm::GlobalValue::LinkOnceAnyLinkage: - GV->setLinkage(GlobalValue::WeakAnyLinkage); - break; - case llvm::GlobalValue::LinkOnceODRLinkage: - GV->setLinkage(GlobalValue::WeakODRLinkage); - break; - } - Keep.push_back(GV); - } + if (BitcodeFile::shouldSkip(Sym)) + continue; + SymbolBody *B = Bodies[BodyIndex++]; + if (!B || &B->repl() != B || !isa(B)) + continue; + switch (GV->getLinkage()) { + default: + break; + case llvm::GlobalValue::LinkOnceAnyLinkage: + GV->setLinkage(GlobalValue::WeakAnyLinkage); + break; + case llvm::GlobalValue::LinkOnceODRLinkage: + GV->setLinkage(GlobalValue::WeakODRLinkage); + break; } + Keep.push_back(GV); } Mover.move(Obj->takeModule(), Keep, -- 2.7.4