summaryrefslogtreecommitdiff
path: root/lib/VMCore/Type.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-08 19:41:01 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-08 19:41:01 +0000
commit877e7ce051aa0b29e68be9a5633cc8e17e2ec332 (patch)
treec5b53ddc7a2b96485c5a51c7e1527fe0c515850b /lib/VMCore/Type.cpp
parent5e85cd2723d7c219a28123928b9164c67d16c21f (diff)
downloadllvm-877e7ce051aa0b29e68be9a5633cc8e17e2ec332.tar.gz
llvm-877e7ce051aa0b29e68be9a5633cc8e17e2ec332.tar.bz2
llvm-877e7ce051aa0b29e68be9a5633cc8e17e2ec332.tar.xz
Parameter attributes are part of a FunctionType and deserve to be factored
into comparisons of two FunctionTypes. Make it so. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Type.cpp')
-rw-r--r--lib/VMCore/Type.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index 25da1e3a85..258aed0393 100644
--- a/lib/VMCore/Type.cpp
+++ b/lib/VMCore/Type.cpp
@@ -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!");