diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-06-20 14:18:48 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-06-20 14:18:48 +0000 |
commit | c137120bb047a7017cbab21f5f9c9e6f65e2b84f (patch) | |
tree | 146a56f5331f05c10548bd0ca1f7bc0726f3ed8f /lib/Target | |
parent | 691c05bb29d3e2ec9c2ed6b1c082ce5d484b75da (diff) | |
download | external_llvm-c137120bb047a7017cbab21f5f9c9e6f65e2b84f.zip external_llvm-c137120bb047a7017cbab21f5f9c9e6f65e2b84f.tar.gz external_llvm-c137120bb047a7017cbab21f5f9c9e6f65e2b84f.tar.bz2 |
Make better use of the PHINode API.
Change various bits of code to make better use of the existing PHINode
API, to insulate them from forthcoming changes in how PHINodes store
their operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133434 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/CppBackend/CPPBackend.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index d7d40c8..2ba773b 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -1353,9 +1353,10 @@ void CppWriter::printInstruction(const Instruction *I, printEscapedString(phi->getName()); Out << "\", " << bbname << ");"; nl(Out); - for (unsigned i = 0; i < phi->getNumOperands(); i+=2) { + for (unsigned i = 0; i < phi->getNumIncomingValues(); ++i) { Out << iName << "->addIncoming(" - << opNames[i] << ", " << opNames[i+1] << ");"; + << opNames[PHINode::getOperandNumForIncomingValue(i)] << ", " + << opNames[PHINode::getOperandNumForIncomingBlock(i)] << ");"; nl(Out); } break; |