mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
[opaque pointer type] Bitcode support for explicit type parameter on the gep operator
This happened to be fairly easy to support backwards compatibility based on the number of operands (old format had an even number, new format has one more operand so an odd number). test/Bitcode/old-aliases.ll already appears to test old gep operators (if I remove the backwards compatibility in the BitcodeReader, this and another test fail) so I'm not adding extra test coverage here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232216 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1522,15 +1522,18 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
|
||||
Record.push_back(Flags);
|
||||
}
|
||||
break;
|
||||
case Instruction::GetElementPtr:
|
||||
case Instruction::GetElementPtr: {
|
||||
Code = bitc::CST_CODE_CE_GEP;
|
||||
if (cast<GEPOperator>(C)->isInBounds())
|
||||
const auto *GO = cast<GEPOperator>(C);
|
||||
if (GO->isInBounds())
|
||||
Code = bitc::CST_CODE_CE_INBOUNDS_GEP;
|
||||
Record.push_back(VE.getTypeID(GO->getSourceElementType()));
|
||||
for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) {
|
||||
Record.push_back(VE.getTypeID(C->getOperand(i)->getType()));
|
||||
Record.push_back(VE.getValueID(C->getOperand(i)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Instruction::Select:
|
||||
Code = bitc::CST_CODE_CE_SELECT;
|
||||
Record.push_back(VE.getValueID(C->getOperand(0)));
|
||||
|
Reference in New Issue
Block a user