Simplify since this function never fails.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 3 Dec 2015 23:56:42 +0000 (23:56 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 3 Dec 2015 23:56:42 +0000 (23:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254667 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/LTO/LTOModule.h
lib/LTO/LTOModule.cpp

index c3e86afe1d82b3ea8a42038fe8e119054f525126..83a523613a76a6b4376b3e4ebfc1be9cc1ca7dfa 100644 (file)
@@ -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,
index d28563c23b806224cb0932374fffd66ec775ca89..42a568b54c7b623c3876cb23c07515c11faa9813 100644 (file)
@@ -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