Drop SrcStructTypesSet. It is redundant.
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 1 Dec 2014 18:42:18 +0000 (18:42 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 1 Dec 2014 18:42:18 +0000 (18:42 +0000)
At the only point in the code it is used, we haven't added any of the src types
to DstStructTypesSet yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223057 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkModules.cpp

index 176df428cb64660a4a10af32be29fc8a2eb8bf50..78826c28c03900379d8be8a33ed0f84ed5c71de2 100644 (file)
@@ -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);
   }