mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3711 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -329,13 +329,19 @@ bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
|
||||
case Instruction::Malloc:
|
||||
if (Raw.NumOperands > 2) return true;
|
||||
V = Raw.NumOperands ? getValue(Type::UIntTy, Raw.Arg1) : 0;
|
||||
Res = new MallocInst(Raw.Ty, V);
|
||||
if (const PointerType *PTy = dyn_cast<PointerType>(Raw.Ty))
|
||||
Res = new MallocInst(PTy->getElementType(), V);
|
||||
else
|
||||
return true;
|
||||
return false;
|
||||
|
||||
case Instruction::Alloca:
|
||||
if (Raw.NumOperands > 2) return true;
|
||||
V = Raw.NumOperands ? getValue(Type::UIntTy, Raw.Arg1) : 0;
|
||||
Res = new AllocaInst(Raw.Ty, V);
|
||||
if (const PointerType *PTy = dyn_cast<PointerType>(Raw.Ty))
|
||||
Res = new AllocaInst(PTy->getElementType(), V);
|
||||
else
|
||||
return true;
|
||||
return false;
|
||||
|
||||
case Instruction::Free:
|
||||
|
||||
Reference in New Issue
Block a user