mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Roundtrip the inalloca bit on allocas through bitcode
This was an oversight in the original support. As it is, I stuffed this bit into the alignment. The alignment is stored in log2 form, so it doesn't need more than 5 bits, given that Value::MaximumAlignment is 1 << 29. Reviewers: nicholas Differential Revision: http://reviews.llvm.org/D3943 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213118 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -2889,10 +2889,14 @@ std::error_code BitcodeReader::ParseFunctionBody(Function *F) {
|
||||
dyn_cast_or_null<PointerType>(getTypeByID(Record[0]));
|
||||
Type *OpTy = getTypeByID(Record[1]);
|
||||
Value *Size = getFnValueByID(Record[2], OpTy);
|
||||
unsigned Align = Record[3];
|
||||
unsigned AlignRecord = Record[3];
|
||||
bool InAlloca = AlignRecord & (1 << 5);
|
||||
unsigned Align = AlignRecord & ((1 << 5) - 1);
|
||||
if (!Ty || !Size)
|
||||
return Error(InvalidRecord);
|
||||
I = new AllocaInst(Ty->getElementType(), Size, (1 << Align) >> 1);
|
||||
AllocaInst *AI = new AllocaInst(Ty->getElementType(), Size, (1 << Align) >> 1);
|
||||
AI->setUsedWithInAlloca(InAlloca);
|
||||
I = AI;
|
||||
InstructionList.push_back(I);
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user