From e33c94f1b06b4fd5f08cce1e0625c6b6ac474f77 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 5 Sep 2017 20:14:58 +0000 Subject: Add llvm.codeview.annotation to implement MSVC __annotation Summary: This intrinsic represents a label with a list of associated metadata strings. It is modelled as reading and writing inaccessible memory so that it won't be removed as dead code. I think the intention is that the annotation strings should appear at most once in the debug info, so I marked it noduplicate. We are allowed to inline code with annotations as long as we strip the annotation, but that can be done later. Reviewers: majnemer Subscribers: eraman, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D36904 llvm-svn: 312569 --- llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp index 1d20c5a67b6..7a123e3e92e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp @@ -935,10 +935,14 @@ EmitSpecialNode(SDNode *Node, bool IsClone, bool IsCloned, EmitCopyFromReg(Node, 0, IsClone, IsCloned, SrcReg, VRBaseMap); break; } - case ISD::EH_LABEL: { - MCSymbol *S = cast(Node)->getLabel(); + case ISD::EH_LABEL: + case ISD::ANNOTATION_LABEL: { + unsigned Opc = (Node->getOpcode() == ISD::EH_LABEL) + ? TargetOpcode::EH_LABEL + : TargetOpcode::ANNOTATION_LABEL; + MCSymbol *S = cast(Node)->getLabel(); BuildMI(*MBB, InsertPos, Node->getDebugLoc(), - TII->get(TargetOpcode::EH_LABEL)).addSym(S); + TII->get(Opc)).addSym(S); break; } -- cgit v1.2.3