From 34254063b545bbbd722e3a7fba029b3e3653762a Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 3 Dec 2015 23:56:42 +0000 Subject: [PATCH] Simplify since this function never fails. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254667 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/LTO/LTOModule.h | 2 +- lib/LTO/LTOModule.cpp | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/include/llvm/LTO/LTOModule.h b/include/llvm/LTO/LTOModule.h index c3e86afe1d8..83a523613a7 100644 --- a/include/llvm/LTO/LTOModule.h +++ b/include/llvm/LTO/LTOModule.h @@ -170,7 +170,7 @@ private: /// Parse the symbols from the module and model-level ASM and add them to /// either the defined or undefined lists. - bool parseSymbols(std::string &errMsg); + void parseSymbols(); /// Add a symbol which isn't defined just yet to a list to be resolved later. void addPotentialUndefinedSymbol(const object::BasicSymbolRef &Sym, diff --git a/lib/LTO/LTOModule.cpp b/lib/LTO/LTOModule.cpp index d28563c23b8..42a568b54c7 100644 --- a/lib/LTO/LTOModule.cpp +++ b/lib/LTO/LTOModule.cpp @@ -252,11 +252,7 @@ LTOModule *LTOModule::makeLTOModule(MemoryBufferRef Buffer, else Ret = new LTOModule(std::move(IRObj), target); - if (Ret->parseSymbols(errMsg)) { - delete Ret; - return nullptr; - } - + Ret->parseSymbols(); Ret->parseMetadata(); return Ret; @@ -592,9 +588,7 @@ void LTOModule::addPotentialUndefinedSymbol(const object::BasicSymbolRef &Sym, info.symbol = decl; } -/// parseSymbols - Parse the symbols from the module and model-level ASM and add -/// them to either the defined or undefined lists. -bool LTOModule::parseSymbols(std::string &errMsg) { +void LTOModule::parseSymbols() { for (auto &Sym : IRFile->symbols()) { const GlobalValue *GV = IRFile->getSymbolGV(Sym.getRawDataRefImpl()); uint32_t Flags = Sym.getFlags(); @@ -649,8 +643,6 @@ bool LTOModule::parseSymbols(std::string &errMsg) { NameAndAttributes info = u->getValue(); _symbols.push_back(info); } - - return false; } /// parseMetadata - Parse metadata from the module