Teach mergefunc that intptr_t is the same width as a pointer. We still can't

merge vector<intptr_t>::push_back() and vector<void*>::push_back() because
Enumerate() doesn't realize that "i64* null" and "i8** null" are equivalent.

llvm-svn: 124285
This commit is contained in:
Nick Lewycky 2011-01-26 09:13:58 +00:00
parent fb622f9920
commit 82d4db8662
1 changed files with 7 additions and 1 deletions

View File

@ -286,8 +286,14 @@ bool FunctionComparator::isEquivalentType(const Type *Ty1,
const Type *Ty2) const {
if (Ty1 == Ty2)
return true;
if (Ty1->getTypeID() != Ty2->getTypeID())
if (Ty1->getTypeID() != Ty2->getTypeID()) {
if (TD) {
LLVMContext &Ctx = Ty1->getContext();
if (isa<PointerType>(Ty1) && Ty2 == TD->getIntPtrType(Ctx)) return true;
if (isa<PointerType>(Ty2) && Ty1 == TD->getIntPtrType(Ctx)) return true;
}
return false;
}
switch(Ty1->getTypeID()) {
default: