diff options
author | John Criswell <criswell@uiuc.edu> | 2004-10-25 18:30:09 +0000 |
---|---|---|
committer | John Criswell <criswell@uiuc.edu> | 2004-10-25 18:30:09 +0000 |
commit | a564e9e0ba79c2f80c344261a3f2fb7f4dc19ea5 (patch) | |
tree | 3cf6695014ccf1f8351e7db8c0f1aab44b4b44e4 /llvm/lib/Target/CBackend | |
parent | 100080cc38caaff5d3be21f6c0435467ecd55614 (diff) | |
download | bcm5719-llvm-a564e9e0ba79c2f80c344261a3f2fb7f4dc19ea5.tar.gz bcm5719-llvm-a564e9e0ba79c2f80c344261a3f2fb7f4dc19ea5.zip |
Modified switch generation so that only the phi values associated with the
destination basic block are copied.
llvm-svn: 17212
Diffstat (limited to 'llvm/lib/Target/CBackend')
-rw-r--r-- | llvm/lib/Target/CBackend/Writer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/CBackend/Writer.cpp b/llvm/lib/Target/CBackend/Writer.cpp index 7af9bfe4fa6..16d83c37717 100644 --- a/llvm/lib/Target/CBackend/Writer.cpp +++ b/llvm/lib/Target/CBackend/Writer.cpp @@ -1194,11 +1194,11 @@ void CWriter::visitReturnInst(ReturnInst &I) { } void CWriter::visitSwitchInst(SwitchInst &SI) { - printPHICopiesForSuccessors(SI.getParent(), 0); Out << " switch ("; writeOperand(SI.getOperand(0)); Out << ") {\n default:\n"; + printPHICopiesForSuccessor (SI.getParent(), SI.getDefaultDest(), 2); printBranchToBlock(SI.getParent(), SI.getDefaultDest(), 2); Out << ";\n"; for (unsigned i = 2, e = SI.getNumOperands(); i != e; i += 2) { @@ -1206,6 +1206,7 @@ void CWriter::visitSwitchInst(SwitchInst &SI) { writeOperand(SI.getOperand(i)); Out << ":\n"; BasicBlock *Succ = cast<BasicBlock>(SI.getOperand(i+1)); + printPHICopiesForSuccessor (SI.getParent(), Succ, 2); printBranchToBlock(SI.getParent(), Succ, 2); if (Succ == SI.getParent()->getNext()) Out << " break;\n"; |