diff options
author | Hsiangkai Wang <hsiangkai@gmail.com> | 2018-08-18 14:55:34 +0000 |
---|---|---|
committer | Hsiangkai Wang <hsiangkai@gmail.com> | 2018-08-18 14:55:34 +0000 |
commit | 68c706ceb7b567ca1c02c97533ada4c169574b7e (patch) | |
tree | 916c644a3422877bd2258e726397af3bd7be671a /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | 911efbb926414f15278a7c761f9e12c6f3efbc3e (diff) | |
download | bcm5719-llvm-68c706ceb7b567ca1c02c97533ada4c169574b7e.tar.gz bcm5719-llvm-68c706ceb7b567ca1c02c97533ada4c169574b7e.zip |
[DebugInfo] In FastISel, convert llvm.dbg.label to DBG_LABEL MI.
Convert llvm.dbg.label(!label_metadata) to DBG_LABEL !label_metadata.
Differential Revision: https://reviews.llvm.org/D50622
llvm-svn: 340122
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 795ade588b8..60af537b715 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -1426,6 +1426,18 @@ bool FastISel::selectIntrinsicCall(const IntrinsicInst *II) { } return true; } + case Intrinsic::dbg_label: { + const DbgLabelInst *DI = cast<DbgLabelInst>(II); + assert(DI->getLabel() && "Missing label"); + if (!FuncInfo.MF->getMMI().hasDebugInfo()) { + LLVM_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; |