mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Don't emit things like malloc(16*1). Allocation instructions are fixed arity now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12086 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7252939af0
commit
0a94348fb9
@ -101,7 +101,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
|
|||||||
Value *MallocArg = ConstantUInt::get(Type::UIntTy, Size);
|
Value *MallocArg = ConstantUInt::get(Type::UIntTy, Size);
|
||||||
if (MI->getNumOperands() && Size == 1) {
|
if (MI->getNumOperands() && Size == 1) {
|
||||||
MallocArg = MI->getOperand(0); // Operand * 1 = Operand
|
MallocArg = MI->getOperand(0); // Operand * 1 = Operand
|
||||||
} else if (MI->getNumOperands()) {
|
} else if (MI->isArrayAllocation()) {
|
||||||
// Multiply it by the array size if necessary...
|
// Multiply it by the array size if necessary...
|
||||||
MallocArg = BinaryOperator::create(Instruction::Mul, MI->getOperand(0),
|
MallocArg = BinaryOperator::create(Instruction::Mul, MI->getOperand(0),
|
||||||
MallocArg, "", I);
|
MallocArg, "", I);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user