summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRParser/MIParser.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-07-21 16:59:53 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-07-21 16:59:53 +0000
commit6ede37442d263084bc48d6a8e9c9c728c44f583b (patch)
tree5a24007d18fac4edfedb8edb01f23b2ce895fb47 /llvm/lib/CodeGen/MIRParser/MIParser.cpp
parent74ce2e76919bc17ff32c4ba941080732800c35fa (diff)
downloadbcm5719-llvm-6ede37442d263084bc48d6a8e9c9c728c44f583b.tar.gz
bcm5719-llvm-6ede37442d263084bc48d6a8e9c9c728c44f583b.zip
MIR Serialization: Serialize the external symbol machine operands.
Reviewers: Duncan P. N. Exon Smith llvm-svn: 242806
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIParser.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIParser.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
index 34d3e1e3c53..ca98ae3c97f 100644
--- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
@@ -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:
OpenPOWER on IntegriCloud