mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
Use type form of getIntPtrType in alloca visitor.
This doesn't actually matter, since alloca is always 0 address space, but this is more consistent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189853 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b9daaa02a2
commit
aa31d35dc7
@ -154,7 +154,7 @@ Instruction *InstCombiner::visitAllocaInst(AllocaInst &AI) {
|
||||
// Ensure that the alloca array size argument has type intptr_t, so that
|
||||
// any casting is exposed early.
|
||||
if (TD) {
|
||||
Type *IntPtrTy = TD->getIntPtrType(AI.getContext());
|
||||
Type *IntPtrTy = TD->getIntPtrType(AI.getType());
|
||||
if (AI.getArraySize()->getType() != IntPtrTy) {
|
||||
Value *V = Builder->CreateIntCast(AI.getArraySize(),
|
||||
IntPtrTy, false);
|
||||
@ -181,7 +181,7 @@ Instruction *InstCombiner::visitAllocaInst(AllocaInst &AI) {
|
||||
// insert our getelementptr instruction...
|
||||
//
|
||||
Type *IdxTy = TD
|
||||
? TD->getIntPtrType(AI.getContext())
|
||||
? TD->getIntPtrType(AI.getType())
|
||||
: Type::getInt64Ty(AI.getContext());
|
||||
Value *NullIdx = Constant::getNullValue(IdxTy);
|
||||
Value *Idx[2] = { NullIdx, NullIdx };
|
||||
|
Loading…
x
Reference in New Issue
Block a user