[llvm] r223057 - Drop SrcStructTypesSet. It is redundant.

Rafael Espindola rafael.espindola at gmail.com
Mon Dec 1 10:42:18 PST 2014


Author: rafael
Date: Mon Dec  1 12:42:18 2014
New Revision: 223057

URL: http://llvm.org/viewvc/llvm-project?rev=223057&view=rev
Log:
Drop SrcStructTypesSet. It is redundant.

At the only point in the code it is used, we haven't added any of the src types
to DstStructTypesSet yet.

Modified:
    llvm/trunk/lib/Linker/LinkModules.cpp

Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=223057&r1=223056&r2=223057&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Dec  1 12:42:18 2014
@@ -793,8 +793,6 @@ void ModuleLinker::computeTypeMapping()
   // it had the same type, it would have been renamed to "%foo.42 = { i32 }".
   TypeFinder SrcStructTypes;
   SrcStructTypes.run(*SrcM, true);
-  SmallPtrSet<StructType*, 32> SrcStructTypesSet(SrcStructTypes.begin(),
-                                                 SrcStructTypes.end());
 
   for (unsigned i = 0, e = SrcStructTypes.size(); i != e; ++i) {
     StructType *ST = SrcStructTypes[i];
@@ -826,7 +824,7 @@ void ModuleLinker::computeTypeMapping()
       // we prefer to take the '%C' version. So we are then left with both
       // '%C.1' and '%C' being used for the same types. This leads to some
       // variables using one type and some using the other.
-      if (!SrcStructTypesSet.count(DST) && TypeMap.DstStructTypesSet.count(DST))
+      if (TypeMap.DstStructTypesSet.count(DST))
         TypeMap.addTypeMapping(DST, ST);
   }
 





More information about the llvm-commits mailing list