diff options
Diffstat (limited to 'lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r-- | lib/Target/CppBackend/CPPBackend.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 7b7d0b0cff..ef1cd5c0ad 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -1673,13 +1673,7 @@ std::string CppWriter::generateInstruction(const Instruction *I) { break; } case Instruction::PtrToInt: - text = getAssign(iName, Type::getInt32Ty(I->getContext())); - if (const Constant *CV = dyn_cast<Constant>(I->getOperand(0))) { - text += utostr(getConstAsOffset(CV)); - } else { - text += getCast(getValueAsStr(I->getOperand(0)), Type::getInt32Ty(I->getContext())); - } - text += ";"; + text = getAssign(iName, Type::getInt32Ty(I->getContext())) + getPtr(I->getOperand(0)) + ';'; break; case Instruction::IntToPtr: text = getAssign(iName, Type::getInt32Ty(I->getContext())) + getValueAsStr(I->getOperand(0)) + ";"; |