[llvm] r209519 - Aliases are always definition, delete dead code.

Rafael Espindola rafael.espindola at gmail.com
Fri May 23 08:18:06 PDT 2014


Author: rafael
Date: Fri May 23 10:18:06 2014
New Revision: 209519

URL: http://llvm.org/viewvc/llvm-project?rev=209519&view=rev
Log:
Aliases are always definition, delete dead code.

While at it, use a range loop.

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

Modified: llvm/trunk/lib/LTO/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOModule.cpp?rev=209519&r1=209518&r2=209519&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTOModule.cpp (original)
+++ llvm/trunk/lib/LTO/LTOModule.cpp Fri May 23 10:18:06 2014
@@ -800,14 +800,8 @@ bool LTOModule::parseSymbols(std::string
     return true;
 
   // add aliases
-  for (Module::alias_iterator a = _module->alias_begin(),
-         e = _module->alias_end(); a != e; ++a) {
-    if (isDeclaration(*a->getAliasee()))
-      // Is an alias to a declaration.
-      addPotentialUndefinedSymbol(a, false);
-    else
-      addDefinedDataSymbol(a);
-  }
+  for (const auto &Alias : _module->aliases())
+    addDefinedDataSymbol(&Alias);
 
   // make symbols for all undefines
   for (StringMap<NameAndAttributes>::iterator u =_undefines.begin(),





More information about the llvm-commits mailing list