From 62b84e2724220703f624761e3cbb0aebf3acede2 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Fri, 21 Aug 2015 21:12:44 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245737 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MIRParser/MIParser.cpp | 2 +- lib/CodeGen/MIRPrinter.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/CodeGen/MIRParser/MIParser.cpp b/lib/CodeGen/MIRParser/MIParser.cpp index d706f04eccc..7a12bae329c 100644 --- a/lib/CodeGen/MIRParser/MIParser.cpp +++ b/lib/CodeGen/MIRParser/MIParser.cpp @@ -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; diff --git a/lib/CodeGen/MIRPrinter.cpp b/lib/CodeGen/MIRPrinter.cpp index 4b4d7b4f25c..aa3d193695a 100644 --- a/lib/CodeGen/MIRPrinter.cpp +++ b/lib/CodeGen/MIRPrinter.cpp @@ -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 << ""; + 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"); } } -- 2.11.0