diff options
author | Chris Lattner <sabre@nondot.org> | 2008-06-16 18:27:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-06-16 18:27:53 +0000 |
commit | 6b9bdb7cf105c7fd3be43c5d9b02ad062e1a0f99 (patch) | |
tree | b82cb2a918a0a9ab0ead50c1bc11f1c6c434ef6c /lib/Linker/LinkModules.cpp | |
parent | 06638ab14055d37d39c5d912965cd885abbf0286 (diff) | |
download | external_llvm-6b9bdb7cf105c7fd3be43c5d9b02ad062e1a0f99.zip external_llvm-6b9bdb7cf105c7fd3be43c5d9b02ad062e1a0f99.tar.gz external_llvm-6b9bdb7cf105c7fd3be43c5d9b02ad062e1a0f99.tar.bz2 |
handle vectors. Any integers that got here would necessarily be different already.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52341 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker/LinkModules.cpp')
-rw-r--r-- | lib/Linker/LinkModules.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index e36fbaf..14fe995 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -102,12 +102,8 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy, // 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 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy, } 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 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy, 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 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy, Pointers.pop_back(); return Result; } - default: assert(0 && "Unexpected type!"); return true; } } |