summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRParser/MIParser.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-08-20 00:20:03 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-08-20 00:20:03 +0000
commit36efd3883dacd6e34c2e4895035d67f842e090b9 (patch)
treec15d43e234f14bbb4088065031aa64f3dcc459c9 /llvm/lib/CodeGen/MIRParser/MIParser.cpp
parent0d009645a1023aef1ec139bab61f2ea1b406c8ad (diff)
downloadbcm5719-llvm-36efd3883dacd6e34c2e4895035d67f842e090b9.tar.gz
bcm5719-llvm-36efd3883dacd6e34c2e4895035d67f842e090b9.zip
MIR Serialization: Use the global value syntax for global value memory operands.
This commit modifies the serialization syntax so that the global IR values in machine memory operands use the global value '@<name>' syntax instead of the current '%ir.<name>' syntax. The unnamed global IR values are handled by this commit as well, as the existing global value parsing method can parse the unnamed globals already. llvm-svn: 245527
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIParser.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIParser.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
index 3260249d95b..d706f04eccc 100644
--- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
@@ -1531,9 +1531,6 @@ bool MIParser::parseIRValue(const Value *&V) {
switch (Token.kind()) {
case MIToken::NamedIRValue: {
V = MF.getFunction()->getValueSymbolTable().lookup(Token.stringValue());
- if (!V)
- V = MF.getFunction()->getParent()->getValueSymbolTable().lookup(
- Token.stringValue());
break;
}
case MIToken::IRValue: {
@@ -1543,6 +1540,14 @@ bool MIParser::parseIRValue(const Value *&V) {
V = getIRValue(SlotNumber);
break;
}
+ case MIToken::NamedGlobalValue:
+ case MIToken::GlobalValue: {
+ GlobalValue *GV = nullptr;
+ if (parseGlobalValue(GV))
+ return true;
+ V = GV;
+ break;
+ }
default:
llvm_unreachable("The current token should be an IR block reference");
}
@@ -1646,7 +1651,9 @@ bool MIParser::parseMachinePointerInfo(MachinePointerInfo &Dest) {
Dest = MachinePointerInfo(PSV, Offset);
return false;
}
- if (Token.isNot(MIToken::NamedIRValue) && Token.isNot(MIToken::IRValue))
+ if (Token.isNot(MIToken::NamedIRValue) && Token.isNot(MIToken::IRValue) &&
+ Token.isNot(MIToken::GlobalValue) &&
+ Token.isNot(MIToken::NamedGlobalValue))
return error("expected an IR value reference");
const Value *V = nullptr;
if (parseIRValue(V))
OpenPOWER on IntegriCloud