[PATCH] D45034: [DebugInfo] In FastISel, convert llvm.dbg.label to DBG_LABEL MI.

Hsiangkai Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 29 07:10:29 PDT 2018


HsiangKai created this revision.
HsiangKai added reviewers: rnk, chenwj.
Herald added a subscriber: JDevlieghere.

Convert llvm.dbg.label(!label_metadata) to DBG_LABEL !label_metadata.


Repository:
  rL LLVM

https://reviews.llvm.org/D45034

Files:
  lib/CodeGen/SelectionDAG/FastISel.cpp


Index: lib/CodeGen/SelectionDAG/FastISel.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/FastISel.cpp
+++ lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -1400,6 +1400,19 @@
     }
     return true;
   }
+  case Intrinsic::dbg_label: {
+    const DbgLabelInst *DI = cast<DbgLabelInst>(II);
+    assert(DI->getLabel() && "Missing label");
+    if (!FuncInfo.MF->getMMI().hasDebugInfo()) {
+      DEBUG(dbgs() << "Dropping debug info for " << *DI << "\n");
+      return true;
+    }
+
+    BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
+	    TII.get(TargetOpcode::DBG_LABEL))
+	.addMetadata(DI->getLabel());
+    return true;
+  }
   case Intrinsic::objectsize: {
     ConstantInt *CI = cast<ConstantInt>(II->getArgOperand(1));
     unsigned long long Res = CI->isZero() ? -1ULL : 0;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45034.140235.patch
Type: text/x-patch
Size: 833 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180329/9618db26/attachment.bin>


More information about the llvm-commits mailing list