diff options
author | Shiva Chen <shiva0217@gmail.com> | 2018-05-09 02:41:08 +0000 |
---|---|---|
committer | Shiva Chen <shiva0217@gmail.com> | 2018-05-09 02:41:08 +0000 |
commit | cd070cdc94ef5f2da3d3a9724c4fcde778fcd163 (patch) | |
tree | 314d9c0f1739fa65209925f1bb1cb0832e7fbeb3 /llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h | |
parent | 2c864551df3945f50e1780b2f2c880ec358ae715 (diff) | |
download | bcm5719-llvm-cd070cdc94ef5f2da3d3a9724c4fcde778fcd163.tar.gz bcm5719-llvm-cd070cdc94ef5f2da3d3a9724c4fcde778fcd163.zip |
[DebugInfo] Convert intrinsic llvm.dbg.label to MachineInstr.
In order to convert LLVM IR to MachineInstr, we need a new TargetOpcode,
DBG_LABEL, to ‘lower’ intrinsic llvm.dbg.label. The patch
creates this new TargetOpcode and convert intrinsic llvm.dbg.label to
MachineInstr through SelectionDAG.
In SelectionDAG, debug information is stored in SDDbgInfo. We create a
new data member of SDDbgInfo for labels and use the new data member,
SDDbgLabel, to create DBG_LABEL MachineInstr.
The new DBG_LABEL MachineInstr uses label metadata from LLVM IR as its
parameter. So, the backend could get metadata information of labels from
DBG_LABEL MachineInstr.
Differential Revision: https://reviews.llvm.org/D45341
Patch by Hsiangkai Wang.
llvm-svn: 331842
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h b/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h index 166ff7127da..703eaa453ab 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h +++ b/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h @@ -128,6 +128,28 @@ public: bool isInvalidated() const { return Invalid; } }; +/// Holds the information from a dbg_label node through SDISel. +/// We do not use SDValue here to avoid including its header. +class SDDbgLabel { + MDNode *Label; + DebugLoc DL; + unsigned Order; + +public: + SDDbgLabel(MDNode *Label, DebugLoc dl, unsigned O) + : Label(Label), DL(std::move(dl)), Order(O) {} + + /// Returns the MDNode pointer for the label. + MDNode *getLabel() const { return Label; } + + /// Returns the DebugLoc. + DebugLoc getDebugLoc() const { return DL; } + + /// Returns the SDNodeOrder. This is the order of the preceding node in the + /// input. + unsigned getOrder() const { return Order; } +}; + } // end llvm namespace #endif |