From fc0f4010bb4c4fb843218c6e3aa0112ffc67c299 Mon Sep 17 00:00:00 2001 From: Xiang1 Zhang Date: Mon, 14 Dec 2020 17:42:21 -0800 Subject: Revert "[Debugify] Support checking Machine IR debug info" This reverts commit 57a3d9ec4a8c1422f07264bed9f12a4ea416707e. --- llvm/lib/CodeGen/MachineDebugify.cpp | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'llvm/lib/CodeGen/MachineDebugify.cpp') diff --git a/llvm/lib/CodeGen/MachineDebugify.cpp b/llvm/lib/CodeGen/MachineDebugify.cpp index 599a818..bf57ec0 100644 --- a/llvm/lib/CodeGen/MachineDebugify.cpp +++ b/llvm/lib/CodeGen/MachineDebugify.cpp @@ -14,7 +14,6 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstrBuilder.h" @@ -90,11 +89,10 @@ bool applyDebugifyMetadataToMachineFunction(MachineModuleInfo &MMI, // Do this by introducing debug uses of each register definition. If that is // not possible (e.g. we have a phi or a meta instruction), emit a constant. uint64_t NextImm = 0; - SmallSet VarSet; const MCInstrDesc &DbgValDesc = TII.get(TargetOpcode::DBG_VALUE); for (MachineBasicBlock &MBB : MF) { MachineBasicBlock::iterator FirstNonPHIIt = MBB.getFirstNonPHI(); - for (auto I = MBB.begin(), E = MBB.end(); I != E;) { + for (auto I = MBB.begin(), E = MBB.end(); I != E; ) { MachineInstr &MI = *I; ++I; @@ -115,7 +113,6 @@ bool applyDebugifyMetadataToMachineFunction(MachineModuleInfo &MMI, Line = EarliestDVI->getDebugLoc().getLine(); DILocalVariable *LocalVar = Line2Var[Line]; assert(LocalVar && "No variable for current line?"); - VarSet.insert(LocalVar); // Emit DBG_VALUEs for register definitions. SmallVector RegDefs; @@ -135,33 +132,6 @@ bool applyDebugifyMetadataToMachineFunction(MachineModuleInfo &MMI, } } - // Here we save the number of lines and variables into "llvm.mir.debugify". - // It is useful for mir-check-debugify. - NamedMDNode *NMD = M.getNamedMetadata("llvm.mir.debugify"); - IntegerType *Int32Ty = Type::getInt32Ty(Ctx); - if (!NMD) { - NMD = M.getOrInsertNamedMetadata("llvm.mir.debugify"); - auto addDebugifyOperand = [&](unsigned N) { - NMD->addOperand(MDNode::get( - Ctx, ValueAsMetadata::getConstant(ConstantInt::get(Int32Ty, N)))); - }; - // Add number of lines. - addDebugifyOperand(NextLine - 1); - // Add number of variables. - addDebugifyOperand(VarSet.size()); - } else { - assert(NMD->getNumOperands() == 2 && - "llvm.mir.debugify should have exactly 2 operands!"); - auto setDebugifyOperand = [&](unsigned Idx, unsigned N) { - NMD->setOperand(Idx, MDNode::get(Ctx, ValueAsMetadata::getConstant( - ConstantInt::get(Int32Ty, N)))); - }; - // Set number of lines. - setDebugifyOperand(0, NextLine - 1); - // Set number of variables. - setDebugifyOperand(1, VarSet.size()); - } - return true; } -- cgit v1.1