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:
Alex Lorenz
2015-07-21 16:59:53 +00:00
parent 5769e19790
commit 65671bf628
7 changed files with 128 additions and 1 deletions

View File

@ -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: