From 7716075a1729ead67844574fdb34579894122992 Mon Sep 17 00:00:00 2001 From: James Y Knight Date: Fri, 1 Feb 2019 20:44:47 +0000 Subject: [opaque pointer types] Pass value type to GetElementPtr creation. This cleans up all GetElementPtr creation in LLVM to explicitly pass a value type rather than deriving it from the pointer's element-type. Differential Revision: https://reviews.llvm.org/D57173 llvm-svn: 352913 --- llvm/lib/CodeGen/SafeStack.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/SafeStack.cpp') diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp index b7a6760df02..f792fc6db91 100644 --- a/llvm/lib/CodeGen/SafeStack.cpp +++ b/llvm/lib/CodeGen/SafeStack.cpp @@ -550,7 +550,7 @@ Value *SafeStack::moveStaticAllocasToUnsafeStack( if (StackGuardSlot) { unsigned Offset = SSL.getObjectOffset(StackGuardSlot); - Value *Off = IRB.CreateGEP(BasePointer, // BasePointer is i8* + Value *Off = IRB.CreateGEP(Int8Ty, BasePointer, // BasePointer is i8* ConstantInt::get(Int32Ty, -Offset)); Value *NewAI = IRB.CreateBitCast(Off, StackGuardSlot->getType(), "StackGuardSlot"); @@ -569,7 +569,7 @@ Value *SafeStack::moveStaticAllocasToUnsafeStack( if (Size == 0) Size = 1; // Don't create zero-sized stack objects. - Value *Off = IRB.CreateGEP(BasePointer, // BasePointer is i8* + Value *Off = IRB.CreateGEP(Int8Ty, BasePointer, // BasePointer is i8* ConstantInt::get(Int32Ty, -Offset)); Value *NewArg = IRB.CreateBitCast(Off, Arg->getType(), Arg->getName() + ".unsafe-byval"); @@ -609,7 +609,7 @@ Value *SafeStack::moveStaticAllocasToUnsafeStack( InsertBefore = User; IRBuilder<> IRBUser(InsertBefore); - Value *Off = IRBUser.CreateGEP(BasePointer, // BasePointer is i8* + Value *Off = IRBUser.CreateGEP(Int8Ty, BasePointer, // BasePointer is i8* ConstantInt::get(Int32Ty, -Offset)); Value *Replacement = IRBUser.CreateBitCast(Off, AI->getType(), Name); @@ -637,7 +637,7 @@ Value *SafeStack::moveStaticAllocasToUnsafeStack( IRB.SetInsertPoint(BasePointer->getNextNode()); Value *StaticTop = - IRB.CreateGEP(BasePointer, ConstantInt::get(Int32Ty, -FrameSize), + IRB.CreateGEP(Int8Ty, BasePointer, ConstantInt::get(Int32Ty, -FrameSize), "unsafe_stack_static_top"); IRB.CreateStore(StaticTop, UnsafeStackPtr); return StaticTop; -- cgit v1.2.3