Revert "[opaque pointer type] Avoid using PointerType::getElementType for a few cases of CallInst"

This reverts commit r235458.

It looks like this might be breaking something LTO-ish. Looking into it
& will recommit with a fix/test case/etc once I've got more to go on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235533 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2015-04-22 18:16:49 +00:00
parent c61f7144eb
commit cfe6126e17
8 changed files with 46 additions and 116 deletions

View File

@ -13,7 +13,6 @@
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/Utils/ValueMapper.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InlineAsm.h"
@ -385,16 +384,6 @@ void llvm::RemapInstruction(Instruction *I, ValueToValueMapTy &VMap,
}
// If the instruction's type is being remapped, do so now.
if (auto CS = CallSite(I)) {
SmallVector<Type *, 3> Tys;
FunctionType *Old = CS.getFunctionType();
unsigned NumOld = Old->getNumParams();
assert(NumOld <= CS.arg_size());
for (unsigned i = 0; i != NumOld; ++i)
Tys.push_back(CS.getArgument(i)->getType());
CS.mutateFunctionType(FunctionType::get(
TypeMapper ? TypeMapper->remapType(I->getType()) : I->getType(), Tys,
Old->isVarArg()));
} else if (TypeMapper)
if (TypeMapper)
I->mutateType(TypeMapper->remapType(I->getType()));
}