diff options
Diffstat (limited to 'lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r-- | lib/Target/CppBackend/CPPBackend.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 550f59b119..51c6ea6d6d 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -1725,7 +1725,9 @@ std::string CppWriter::generateInstruction(const Instruction *I) { } case Instruction::Select: { const SelectInst* SI = cast<SelectInst>(I); - text = getValueAsStr(SI->getCondition()) + " ? " + getValueAsStr(SI->getTrueValue()) + " : " + getValueAsStr(SI->getFalseValue()) + ';'; + text = getAssign(iName, I->getType()) + getValueAsStr(SI->getCondition()) + " ? " + + getValueAsStr(SI->getTrueValue()) + " : " + + getValueAsStr(SI->getFalseValue()) + ';'; break; } case Instruction::UserOp1: |