From a078c77d72082bf6a06486849735cdeaab1374bc Mon Sep 17 00:00:00 2001 From: Amy Huang Date: Tue, 5 Nov 2019 10:54:50 -0800 Subject: [MIR] Add MIR parsing for heap alloc site instruction markers Summary: This patch adds MIR parsing and printing for heap alloc markers, which were added in D69136. They are printed as an operand similar to pre-/post-instr symbols, with a heap-alloc-marker token and a metadata node. Reviewers: rnk Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69864 --- llvm/lib/CodeGen/MIRPrinter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/CodeGen/MIRPrinter.cpp') diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index 1a4e21ac06a..b06e34a809f 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -784,6 +784,13 @@ void MIPrinter::print(const MachineInstr &MI) { MachineOperand::printSymbol(OS, *PostInstrSymbol); NeedComma = true; } + if (MDNode *HeapAllocMarker = MI.getHeapAllocMarker()) { + if (NeedComma) + OS << ','; + OS << " heap-alloc-marker "; + HeapAllocMarker->printAsOperand(OS, MST); + NeedComma = true; + } if (const DebugLoc &DL = MI.getDebugLoc()) { if (NeedComma) -- cgit v1.2.3