From 43a589cc82491ba0faa96ba29f899bc238ebfb91 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 2 Apr 2014 06:38:46 +0000 Subject: [PATCH] Remove dead code. llvm-svn: 205401 --- lld/include/lld/Core/Resolver.h | 5 ++--- lld/lib/Core/Resolver.cpp | 8 ++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lld/include/lld/Core/Resolver.h b/lld/include/lld/Core/Resolver.h index 1a982b72a8cd..c0713011f4ec 100644 --- a/lld/include/lld/Core/Resolver.h +++ b/lld/include/lld/Core/Resolver.h @@ -38,7 +38,7 @@ public: Resolver(LinkingContext &context) : _context(context), _symbolTable(context), _result(new MergedFile()), - _haveLLVMObjs(false), _addToFinalSection(false) {} + _addToFinalSection(false) {} // InputFiles::Handler methods void doDefinedAtom(const DefinedAtom&); @@ -71,7 +71,7 @@ private: bool resolveUndefines(); void updateReferences(); void deadStripOptimize(); - bool checkUndefines(bool isFinal); + bool checkUndefines(); void removeCoalescedAwayAtoms(); void checkDylibSymbolCollisions(); void linkTimeOptimize(); @@ -117,7 +117,6 @@ private: std::vector _atomsWithUnresolvedReferences; llvm::DenseSet _liveAtoms; std::unique_ptr _result; - bool _haveLLVMObjs; bool _addToFinalSection; }; diff --git a/lld/lib/Core/Resolver.cpp b/lld/lib/Core/Resolver.cpp index f42c47edaba5..f7330f651d0d 100644 --- a/lld/lib/Core/Resolver.cpp +++ b/lld/lib/Core/Resolver.cpp @@ -397,11 +397,7 @@ void Resolver::deadStripOptimize() { } // error out if some undefines remain -bool Resolver::checkUndefines(bool isFinal) { - // when using LTO, undefines are checked after bitcode is optimized - if (_haveLLVMObjs && !isFinal) - return false; - +bool Resolver::checkUndefines() { // build vector of remaining undefined symbols std::vector undefinedAtoms; _symbolTable.undefines(undefinedAtoms); @@ -466,7 +462,7 @@ bool Resolver::resolve() { return false; this->updateReferences(); this->deadStripOptimize(); - if (this->checkUndefines(false)) + if (this->checkUndefines()) if (!_context.allowRemainingUndefines()) return false; this->removeCoalescedAwayAtoms();