diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-04-26 22:56:56 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-04-26 22:56:56 +0000 |
commit | cc7354e9936595fd2654e1690310fcdc5ef10971 (patch) | |
tree | 50929a1cc1c25d42400469e5f3b7a71468476f19 /lib/CodeGen/SelectionDAG/InstrEmitter.cpp | |
parent | 5098da0a7e3fb841f71bf5be9211b36fa95f140f (diff) | |
download | llvm-cc7354e9936595fd2654e1690310fcdc5ef10971.tar.gz llvm-cc7354e9936595fd2654e1690310fcdc5ef10971.tar.bz2 llvm-cc7354e9936595fd2654e1690310fcdc5ef10971.tar.xz |
Avoid adding a null MD node operand, which crashes with "-debug" when trying
to print the operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/InstrEmitter.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp index 1afca3debf..f857a1c894 100644 --- a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp +++ b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp @@ -769,7 +769,8 @@ EmitSpecialNode(SDNode *Node, bool IsClone, bool IsCloned, // 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)); + if (MD) + MI->addOperand(MachineOperand::CreateMetadata(MD)); MBB->insert(InsertPos, MI); break; |