summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRParser
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-08-20 00:12:57 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-08-20 00:12:57 +0000
commit0d009645a1023aef1ec139bab61f2ea1b406c8ad (patch)
tree88e38040b353cbc1a1a1232d7aebc75137570286 /llvm/lib/CodeGen/MIRParser
parent7defcae5f753e08eb9fc4a6ebb7a3b34a279177d (diff)
downloadbcm5719-llvm-0d009645a1023aef1ec139bab61f2ea1b406c8ad.tar.gz
bcm5719-llvm-0d009645a1023aef1ec139bab61f2ea1b406c8ad.zip
MIR Serialization: Change syntax for the call entry pseudo source values.
The global IR values in machine memory operands should use the global value '@<name>' syntax instead of the current '%ir.<name>' syntax. However, the global value call entry pseudo source values use the global value syntax already. Therefore, the syntax for the call entry pseudo source values has to be changed so that the global values and call entry global value PSVs can be parsed without ambiguities. llvm-svn: 245526
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MILexer.cpp1
-rw-r--r--llvm/lib/CodeGen/MIRParser/MILexer.h1
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIParser.cpp33
3 files changed, 22 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.cpp b/llvm/lib/CodeGen/MIRParser/MILexer.cpp
index 6094ca996bf..8346ff294e4 100644
--- a/llvm/lib/CodeGen/MIRParser/MILexer.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MILexer.cpp
@@ -220,6 +220,7 @@ static MIToken::TokenKind getIdentifierKind(StringRef Identifier) {
.Case("got", MIToken::kw_got)
.Case("jump-table", MIToken::kw_jump_table)
.Case("constant-pool", MIToken::kw_constant_pool)
+ .Case("call-entry", MIToken::kw_call_entry)
.Case("liveout", MIToken::kw_liveout)
.Case("address-taken", MIToken::kw_address_taken)
.Case("landing-pad", MIToken::kw_landing_pad)
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.h b/llvm/lib/CodeGen/MIRParser/MILexer.h
index 17ddc4d5c1a..35c526be812 100644
--- a/llvm/lib/CodeGen/MIRParser/MILexer.h
+++ b/llvm/lib/CodeGen/MIRParser/MILexer.h
@@ -81,6 +81,7 @@ struct MIToken {
kw_got,
kw_jump_table,
kw_constant_pool,
+ kw_call_entry,
kw_liveout,
kw_address_taken,
kw_landing_pad,
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
index 80f6a654b97..3260249d95b 100644
--- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
@@ -1605,18 +1605,27 @@ bool MIParser::parseMemoryPseudoSourceValue(const PseudoSourceValue *&PSV) {
// The token was already consumed, so use return here instead of break.
return false;
}
- case MIToken::GlobalValue:
- case MIToken::NamedGlobalValue: {
- GlobalValue *GV = nullptr;
- if (parseGlobalValue(GV))
- return true;
- PSV = MF.getPSVManager().getGlobalValueCallEntry(GV);
+ case MIToken::kw_call_entry: {
+ lex();
+ switch (Token.kind()) {
+ case MIToken::GlobalValue:
+ case MIToken::NamedGlobalValue: {
+ GlobalValue *GV = nullptr;
+ if (parseGlobalValue(GV))
+ return true;
+ PSV = MF.getPSVManager().getGlobalValueCallEntry(GV);
+ break;
+ }
+ case MIToken::ExternalSymbol:
+ PSV = MF.getPSVManager().getExternalSymbolCallEntry(
+ MF.createExternalSymbolName(Token.stringValue()));
+ break;
+ default:
+ return error(
+ "expected a global value or an external symbol after 'call-entry'");
+ }
break;
}
- case MIToken::ExternalSymbol:
- PSV = MF.getPSVManager().getExternalSymbolCallEntry(
- MF.createExternalSymbolName(Token.stringValue()));
- break;
default:
llvm_unreachable("The current token should be pseudo source value");
}
@@ -1627,9 +1636,7 @@ bool MIParser::parseMemoryPseudoSourceValue(const PseudoSourceValue *&PSV) {
bool MIParser::parseMachinePointerInfo(MachinePointerInfo &Dest) {
if (Token.is(MIToken::kw_constant_pool) || Token.is(MIToken::kw_stack) ||
Token.is(MIToken::kw_got) || Token.is(MIToken::kw_jump_table) ||
- Token.is(MIToken::FixedStackObject) || Token.is(MIToken::GlobalValue) ||
- Token.is(MIToken::NamedGlobalValue) ||
- Token.is(MIToken::ExternalSymbol)) {
+ Token.is(MIToken::FixedStackObject) || Token.is(MIToken::kw_call_entry)) {
const PseudoSourceValue *PSV = nullptr;
if (parseMemoryPseudoSourceValue(PSV))
return true;
OpenPOWER on IntegriCloud