diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-07 05:38:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-07 05:38:05 +0000 |
commit | cf9a415182aca6a432105a2a12168e1049de180a (patch) | |
tree | cc2f1629b01ff1198cbe3bf2810b7bfeaf2ac9ed /lib/CodeGen/SelectionDAG/InstrEmitter.cpp | |
parent | fee455ea6a7e209a3cac5fc8e601f8e85cfb3792 (diff) | |
download | external_llvm-cf9a415182aca6a432105a2a12168e1049de180a.zip external_llvm-cf9a415182aca6a432105a2a12168e1049de180a.tar.gz external_llvm-cf9a415182aca6a432105a2a12168e1049de180a.tar.bz2 |
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.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp index aa24e01..9495f82 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; } |