summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRParser/MIParser.cpp
diff options
context:
space:
mode:
authorPeng Guo <peng_guo@apple.com>2020-01-10 11:18:11 +0100
committerBenjamin Kramer <benny.kra@googlemail.com>2020-01-10 11:18:12 +0100
commitcfd849840134c4632c2f4fa498dfb93c47825b24 (patch)
tree5f4cbedb08687a31f16bbada31c6593b7fcf0e47 /llvm/lib/CodeGen/MIRParser/MIParser.cpp
parenta1cc19b581443c84fff4c6e6d4e341351ef3203c (diff)
downloadbcm5719-llvm-cfd849840134c4632c2f4fa498dfb93c47825b24.tar.gz
bcm5719-llvm-cfd849840134c4632c2f4fa498dfb93c47825b24.zip
[MIR] Fix cyclic dependency of MIR formatter
Summary: Move MIR formatter pointer from TargetMachine to TargetInstrInfo to avoid cyclic dependency between target & codegen. Reviewers: dsanders, bkramer, arsenm Subscribers: wdng, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72485
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIParser.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIParser.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
index 0f2648e2bfa..11cab488e22 100644
--- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
@@ -2619,7 +2619,8 @@ bool MIParser::parseMachineOperand(const unsigned OpCode, const unsigned OpIdx,
} else
return parseTypedImmediateOperand(Dest);
case MIToken::dot: {
- if (const auto *Formatter = MF.getTarget().getMIRFormatter()) {
+ const auto *TII = MF.getSubtarget().getInstrInfo();
+ if (const auto *Formatter = TII->getMIRFormatter()) {
return parseTargetImmMnemonic(OpCode, OpIdx, Dest, *Formatter);
}
LLVM_FALLTHROUGH;
@@ -2879,7 +2880,8 @@ bool MIParser::parseMemoryPseudoSourceValue(const PseudoSourceValue *&PSV) {
break;
case MIToken::kw_custom: {
lex();
- if (const auto *Formatter = MF.getTarget().getMIRFormatter()) {
+ const auto *TII = MF.getSubtarget().getInstrInfo();
+ if (const auto *Formatter = TII->getMIRFormatter()) {
if (Formatter->parseCustomPseudoSourceValue(
Token.stringValue(), MF, PFS, PSV,
[this](StringRef::iterator Loc, const Twine &Msg) -> bool {
OpenPOWER on IntegriCloud