[llvm] r254667 - Simplify since this function never fails.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 3 15:56:42 PST 2015


Author: rafael
Date: Thu Dec  3 17:56:42 2015
New Revision: 254667

URL: http://llvm.org/viewvc/llvm-project?rev=254667&view=rev
Log:
Simplify since this function never fails.

Modified:
    llvm/trunk/include/llvm/LTO/LTOModule.h
    llvm/trunk/lib/LTO/LTOModule.cpp

Modified: llvm/trunk/include/llvm/LTO/LTOModule.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LTO/LTOModule.h?rev=254667&r1=254666&r2=254667&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LTO/LTOModule.h (original)
+++ llvm/trunk/include/llvm/LTO/LTOModule.h Thu Dec  3 17:56:42 2015
@@ -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,

Modified: llvm/trunk/lib/LTO/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOModule.cpp?rev=254667&r1=254666&r2=254667&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTOModule.cpp (original)
+++ llvm/trunk/lib/LTO/LTOModule.cpp Thu Dec  3 17:56:42 2015
@@ -252,11 +252,7 @@ LTOModule *LTOModule::makeLTOModule(Memo
   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::addPotentialUndefinedSym
   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
     NameAndAttributes info = u->getValue();
     _symbols.push_back(info);
   }
-
-  return false;
 }
 
 /// parseMetadata - Parse metadata from the module




More information about the llvm-commits mailing list