mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 22:24:28 +00:00
[opaque pointer type] Encode the allocated type of an alloca rather than its pointer result type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235998 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1870,15 +1870,16 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
|
||||
|
||||
case Instruction::Alloca: {
|
||||
Code = bitc::FUNC_CODE_INST_ALLOCA;
|
||||
Vals.push_back(VE.getTypeID(I.getType()));
|
||||
const AllocaInst &AI = cast<AllocaInst>(I);
|
||||
Vals.push_back(VE.getTypeID(AI.getAllocatedType()));
|
||||
Vals.push_back(VE.getTypeID(I.getOperand(0)->getType()));
|
||||
Vals.push_back(VE.getValueID(I.getOperand(0))); // size.
|
||||
const AllocaInst &AI = cast<AllocaInst>(I);
|
||||
unsigned AlignRecord = Log2_32(AI.getAlignment()) + 1;
|
||||
assert(Log2_32(Value::MaximumAlignment) + 1 < 1 << 5 &&
|
||||
"not enough bits for maximum alignment");
|
||||
assert(AlignRecord < 1 << 5 && "alignment greater than 1 << 64");
|
||||
AlignRecord |= AI.isUsedWithInAlloca() << 5;
|
||||
AlignRecord |= 1 << 6;
|
||||
Vals.push_back(AlignRecord);
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user