From f22ca8ad358dfd0dcad96320f688268ea2362a72 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. llvm-svn: 245737 --- llvm/lib/CodeGen/MIRParser/MIParser.cpp | 2 +- llvm/lib/CodeGen/MIRPrinter.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp index d706f04eccce..7a12bae329cd 100644 --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/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/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index 4b4d7b4f25cf..aa3d193695a7 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/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"); } }