mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 16:36:40 +00:00
Parameter attributes are part of a FunctionType and deserve to be factored
into comparisons of two FunctionTypes. Make it so. llvm-svn: 33020
This commit is contained in:
parent
d5d091d13b
commit
96ebce2eda
@ -607,11 +607,16 @@ static bool TypesEqual(const Type *Ty, const Type *Ty2,
|
||||
const FunctionType *FTy2 = cast<FunctionType>(Ty2);
|
||||
if (FTy->isVarArg() != FTy2->isVarArg() ||
|
||||
FTy->getNumParams() != FTy2->getNumParams() ||
|
||||
FTy->getNumAttrs() != FTy2->getNumAttrs() ||
|
||||
FTy->getParamAttrs(0) != FTy2->getParamAttrs(0) ||
|
||||
!TypesEqual(FTy->getReturnType(), FTy2->getReturnType(), EqTypes))
|
||||
return false;
|
||||
for (unsigned i = 0, e = FTy2->getNumParams(); i != e; ++i)
|
||||
for (unsigned i = 0, e = FTy2->getNumParams(); i != e; ++i) {
|
||||
if (FTy->getParamAttrs(i+1) != FTy->getParamAttrs(i+1))
|
||||
return false;
|
||||
if (!TypesEqual(FTy->getParamType(i), FTy2->getParamType(i), EqTypes))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
assert(0 && "Unknown derived type!");
|
||||
|
Loading…
Reference in New Issue
Block a user