mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-05 09:24:28 +00:00
MIR Serialization: Serialize the external symbol machine operands.
Reviewers: Duncan P. N. Exon Smith git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242806 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -110,6 +110,7 @@ public:
|
||||
bool parseGlobalAddressOperand(MachineOperand &Dest);
|
||||
bool parseConstantPoolIndexOperand(MachineOperand &Dest);
|
||||
bool parseJumpTableIndexOperand(MachineOperand &Dest);
|
||||
bool parseExternalSymbolOperand(MachineOperand &Dest);
|
||||
bool parseMachineOperand(MachineOperand &Dest);
|
||||
|
||||
private:
|
||||
@ -560,6 +561,17 @@ bool MIParser::parseJumpTableIndexOperand(MachineOperand &Dest) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MIParser::parseExternalSymbolOperand(MachineOperand &Dest) {
|
||||
assert(Token.is(MIToken::ExternalSymbol) ||
|
||||
Token.is(MIToken::QuotedExternalSymbol));
|
||||
StringValueUtility Name(Token);
|
||||
const char *Symbol = MF.createExternalSymbolName(Name);
|
||||
lex();
|
||||
// TODO: Parse the target flags.
|
||||
Dest = MachineOperand::CreateES(Symbol);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MIParser::parseMachineOperand(MachineOperand &Dest) {
|
||||
switch (Token.kind()) {
|
||||
case MIToken::kw_implicit:
|
||||
@ -587,6 +599,9 @@ bool MIParser::parseMachineOperand(MachineOperand &Dest) {
|
||||
return parseConstantPoolIndexOperand(Dest);
|
||||
case MIToken::JumpTableIndex:
|
||||
return parseJumpTableIndexOperand(Dest);
|
||||
case MIToken::ExternalSymbol:
|
||||
case MIToken::QuotedExternalSymbol:
|
||||
return parseExternalSymbolOperand(Dest);
|
||||
case MIToken::Error:
|
||||
return true;
|
||||
case MIToken::Identifier:
|
||||
|
Reference in New Issue
Block a user