forked from OSchip/llvm-project
MIR Serialization: Print MCSymbol operands.
This commit allows the MIR printer to print the MCSymbol machine operands. Unfortunately they can't be parsed at this time. I will create a bug that will track the fact that the MCSymbol operands can't be parsed yet. llvm-svn: 245737
This commit is contained in:
parent
76b91d9084
commit
f22ca8ad35
|
@ -1442,7 +1442,7 @@ bool MIParser::parseMachineOperand(MachineOperand &Dest,
|
|||
}
|
||||
// fallthrough
|
||||
default:
|
||||
// TODO: parse the other machine operands.
|
||||
// FIXME: Parse the MCSymbol machine operand.
|
||||
return error("expected a machine operand");
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "llvm/IR/IRPrintingPasses.h"
|
||||
#include "llvm/IR/Module.h"
|
||||
#include "llvm/IR/ModuleSlotTracker.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Support/YAMLTraits.h"
|
||||
|
@ -826,14 +827,14 @@ void MIPrinter::print(const MachineOperand &Op, const TargetRegisterInfo *TRI,
|
|||
case MachineOperand::MO_Metadata:
|
||||
Op.getMetadata()->printAsOperand(OS, MST);
|
||||
break;
|
||||
case MachineOperand::MO_MCSymbol:
|
||||
OS << "<mcsymbol " << *Op.getMCSymbol() << ">";
|
||||
break;
|
||||
case MachineOperand::MO_CFIIndex: {
|
||||
const auto &MMI = Op.getParent()->getParent()->getParent()->getMMI();
|
||||
print(MMI.getFrameInstructions()[Op.getCFIIndex()], TRI);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// TODO: Print the other machine operands.
|
||||
llvm_unreachable("Can't print this machine operand at the moment");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue