summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2012-02-24 17:53:59 +0000
committerHal Finkel <hfinkel@anl.gov>2012-02-24 17:53:59 +0000
commitf77c03a8599ca354393292bb6c918ea8dab6a21d (patch)
treefeae5597ebd2e14a4e1872723e6114fe05d9247c /lib/CodeGen/SelectionDAG/InstrEmitter.cpp
parente170c76ccdcf9b0343d2d5a2805010ff77b8b56e (diff)
downloadllvm-f77c03a8599ca354393292bb6c918ea8dab6a21d.tar.gz
llvm-f77c03a8599ca354393292bb6c918ea8dab6a21d.tar.bz2
llvm-f77c03a8599ca354393292bb6c918ea8dab6a21d.tar.xz
Don't crash when a glue node contains an internal CopyToReg
This is necessary to support the existing ppc lowering code for indirect calls. Fixes PR12071. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/InstrEmitter.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/InstrEmitter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
index 3f4f9e2625..1467d88778 100644
--- a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
+++ b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
@@ -766,6 +766,9 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned,
if (F->getOpcode() == ISD::CopyFromReg) {
UsedRegs.push_back(cast<RegisterSDNode>(F->getOperand(1))->getReg());
continue;
+ } else if (F->getOpcode() == ISD::CopyToReg) {
+ // Skip CopyToReg nodes that are internal to the glue chain.
+ continue;
}
// Collect declared implicit uses.
const MCInstrDesc &MCID = TII->get(F->getMachineOpcode());