diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIParser.cpp | 11 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MIRPrinter.cpp | 4 |
2 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp index 7984116efcb..31046b91cf8 100644 --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp @@ -1437,6 +1437,14 @@ 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); + break; + } // TODO: Parse the other pseudo source values. default: llvm_unreachable("The current token should be pseudo source value"); @@ -1448,7 +1456,8 @@ 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::FixedStackObject) || Token.is(MIToken::GlobalValue) || + Token.is(MIToken::NamedGlobalValue)) { const PseudoSourceValue *PSV = nullptr; if (parseMemoryPseudoSourceValue(PSV)) return true; diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index 957cb20eace..7e546eb845f 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -763,6 +763,10 @@ void MIPrinter::print(const MachineMemOperand &Op) { printStackObjectReference( cast<FixedStackPseudoSourceValue>(PVal)->getFrameIndex()); break; + case PseudoSourceValue::GlobalValueCallEntry: + cast<GlobalValuePseudoSourceValue>(PVal)->getValue()->printAsOperand( + OS, /*PrintType=*/false, MST); + break; default: // TODO: Print the other pseudo source values. OS << "<unserializable pseudo value>"; |