[llvm-commits] [llvm] r52341 - /llvm/trunk/lib/Linker/LinkModules.cpp

Chris Lattner sabre at nondot.org
Mon Jun 16 11:27:53 PDT 2008


Author: lattner
Date: Mon Jun 16 13:27:53 2008
New Revision: 52341

URL: http://llvm.org/viewvc/llvm-project?rev=52341&view=rev
Log:
handle vectors.  Any integers that got here would necessarily be different already.

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=52341&r1=52340&r2=52341&view=diff

==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Jun 16 13:27:53 2008
@@ -102,12 +102,8 @@
 
   // Otherwise, resolve the used type used by this derived type...
   switch (DestTyT->getTypeID()) {
-  case Type::IntegerTyID: {
-    if (cast<IntegerType>(DestTyT)->getBitWidth() !=
-        cast<IntegerType>(SrcTyT)->getBitWidth())
-      return true;
-    return false;
-  }
+  default:
+    return true;
   case Type::FunctionTyID: {
     if (cast<FunctionType>(DestTyT)->isVarArg() !=
         cast<FunctionType>(SrcTyT)->isVarArg() ||
@@ -122,7 +118,8 @@
   }
   case Type::StructTyID: {
     if (getST(DestTy)->getNumContainedTypes() !=
-        getST(SrcTy)->getNumContainedTypes()) return 1;
+        getST(SrcTy)->getNumContainedTypes())
+      return true;
     for (unsigned i = 0, e = getST(DestTy)->getNumContainedTypes(); i != e; ++i)
       if (RecursiveResolveTypesI(getST(DestTy)->getContainedType(i),
                                  getST(SrcTy)->getContainedType(i), Pointers))
@@ -136,6 +133,13 @@
     return RecursiveResolveTypesI(DAT->getElementType(), SAT->getElementType(),
                                   Pointers);
   }
+  case Type::VectorTyID: {
+    const VectorType *DVT = cast<VectorType>(DestTy.get());
+    const VectorType *SVT = cast<VectorType>(SrcTy.get());
+    if (DVT->getNumElements() != SVT->getNumElements()) return true;
+    return RecursiveResolveTypesI(DVT->getElementType(), SVT->getElementType(),
+                                  Pointers);
+  }
   case Type::PointerTyID: {
     // If this is a pointer type, check to see if we have already seen it.  If
     // so, we are in a recursive branch.  Cut off the search now.  We cannot use
@@ -155,7 +159,6 @@
     Pointers.pop_back();
     return Result;
   }
-  default: assert(0 && "Unexpected type!"); return true;
   }
 }
 





More information about the llvm-commits mailing list