summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-07 05:38:05 +0000
committerChris Lattner <sabre@nondot.org>2010-04-07 05:38:05 +0000
commitcf9a415182aca6a432105a2a12168e1049de180a (patch)
treecc2f1629b01ff1198cbe3bf2810b7bfeaf2ac9ed /lib/CodeGen/SelectionDAG/InstrEmitter.cpp
parentfee455ea6a7e209a3cac5fc8e601f8e85cfb3792 (diff)
downloadllvm-cf9a415182aca6a432105a2a12168e1049de180a.tar.gz
llvm-cf9a415182aca6a432105a2a12168e1049de180a.tar.bz2
llvm-cf9a415182aca6a432105a2a12168e1049de180a.tar.xz
Have the inst emitter add the !srcloc mdnode to the machine instr.
Have the asmprinter use the mdnode to scavenge a source location if present. Document this nonsense in langref. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/InstrEmitter.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/InstrEmitter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
index aa24e01df0..9495f82326 100644
--- a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
+++ b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
@@ -769,6 +769,12 @@ EmitSpecialNode(SDNode *Node, bool IsClone, bool IsCloned,
break;
}
}
+
+ // Get the mdnode from the asm if it exists and add it to the instruction.
+ SDValue MDV = Node->getOperand(InlineAsm::Op_MDNode);
+ const MDNode *MD = cast<MDNodeSDNode>(MDV)->getMD();
+ MI->addOperand(MachineOperand::CreateMetadata(MD));
+
MBB->insert(InsertPos, MI);
break;
}