From 73cf872adb7983c464ad24dc28827defdf6b11d4 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 5 May 2015 18:03:48 +0000 Subject: [opaque pointer type] Track explicit GEP pointee type through in-memory IR llvm-svn: 236510 --- llvm/lib/Transforms/Utils/ValueMapper.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/Transforms/Utils/ValueMapper.cpp') diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp index 5c1518d72ac..cac80accc32 100644 --- a/llvm/lib/Transforms/Utils/ValueMapper.cpp +++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp @@ -400,5 +400,8 @@ void llvm::RemapInstruction(Instruction *I, ValueToValueMapTy &VMap, } if (auto *AI = dyn_cast(I)) AI->setAllocatedType(TypeMapper->remapType(AI->getAllocatedType())); + if (auto *GEP = dyn_cast(I)) + GEP->setSourceElementType( + TypeMapper->remapType(GEP->getSourceElementType())); I->mutateType(TypeMapper->remapType(I->getType())); } -- cgit v1.2.3