mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
MIR Serialization: Serialize the jump table index operands.
Reviewers: Duncan P. N. Exon Smith git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242358 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -88,6 +88,7 @@ public:
|
||||
bool parseMBBReference(MachineBasicBlock *&MBB);
|
||||
bool parseMBBOperand(MachineOperand &Dest);
|
||||
bool parseGlobalAddressOperand(MachineOperand &Dest);
|
||||
bool parseJumpTableIndexOperand(MachineOperand &Dest);
|
||||
bool parseMachineOperand(MachineOperand &Dest);
|
||||
|
||||
private:
|
||||
@@ -468,6 +469,20 @@ bool MIParser::parseGlobalAddressOperand(MachineOperand &Dest) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MIParser::parseJumpTableIndexOperand(MachineOperand &Dest) {
|
||||
assert(Token.is(MIToken::JumpTableIndex));
|
||||
unsigned ID;
|
||||
if (getUnsigned(ID))
|
||||
return true;
|
||||
auto JumpTableEntryInfo = PFS.JumpTableSlots.find(ID);
|
||||
if (JumpTableEntryInfo == PFS.JumpTableSlots.end())
|
||||
return error("use of undefined jump table '%jump-table." + Twine(ID) + "'");
|
||||
lex();
|
||||
// TODO: Parse target flags.
|
||||
Dest = MachineOperand::CreateJTI(JumpTableEntryInfo->second);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MIParser::parseMachineOperand(MachineOperand &Dest) {
|
||||
switch (Token.kind()) {
|
||||
case MIToken::kw_implicit:
|
||||
@@ -486,6 +501,8 @@ bool MIParser::parseMachineOperand(MachineOperand &Dest) {
|
||||
case MIToken::GlobalValue:
|
||||
case MIToken::NamedGlobalValue:
|
||||
return parseGlobalAddressOperand(Dest);
|
||||
case MIToken::JumpTableIndex:
|
||||
return parseJumpTableIndexOperand(Dest);
|
||||
case MIToken::Error:
|
||||
return true;
|
||||
case MIToken::Identifier:
|
||||
|
Reference in New Issue
Block a user