mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
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
This commit is contained in:
parent
bc1c82a0f7
commit
f6f4f7a149
@ -102,12 +102,8 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy,
|
|||||||
|
|
||||||
// Otherwise, resolve the used type used by this derived type...
|
// Otherwise, resolve the used type used by this derived type...
|
||||||
switch (DestTyT->getTypeID()) {
|
switch (DestTyT->getTypeID()) {
|
||||||
case Type::IntegerTyID: {
|
default:
|
||||||
if (cast<IntegerType>(DestTyT)->getBitWidth() !=
|
return true;
|
||||||
cast<IntegerType>(SrcTyT)->getBitWidth())
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case Type::FunctionTyID: {
|
case Type::FunctionTyID: {
|
||||||
if (cast<FunctionType>(DestTyT)->isVarArg() !=
|
if (cast<FunctionType>(DestTyT)->isVarArg() !=
|
||||||
cast<FunctionType>(SrcTyT)->isVarArg() ||
|
cast<FunctionType>(SrcTyT)->isVarArg() ||
|
||||||
@ -122,7 +118,8 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy,
|
|||||||
}
|
}
|
||||||
case Type::StructTyID: {
|
case Type::StructTyID: {
|
||||||
if (getST(DestTy)->getNumContainedTypes() !=
|
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)
|
for (unsigned i = 0, e = getST(DestTy)->getNumContainedTypes(); i != e; ++i)
|
||||||
if (RecursiveResolveTypesI(getST(DestTy)->getContainedType(i),
|
if (RecursiveResolveTypesI(getST(DestTy)->getContainedType(i),
|
||||||
getST(SrcTy)->getContainedType(i), Pointers))
|
getST(SrcTy)->getContainedType(i), Pointers))
|
||||||
@ -136,6 +133,13 @@ static bool RecursiveResolveTypesI(const PATypeHolder &DestTy,
|
|||||||
return RecursiveResolveTypesI(DAT->getElementType(), SAT->getElementType(),
|
return RecursiveResolveTypesI(DAT->getElementType(), SAT->getElementType(),
|
||||||
Pointers);
|
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: {
|
case Type::PointerTyID: {
|
||||||
// If this is a pointer type, check to see if we have already seen it. If
|
// 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
|
// 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();
|
Pointers.pop_back();
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
default: assert(0 && "Unexpected type!"); return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user