From: Reid Spencer Date: Wed, 11 Apr 2007 13:02:56 +0000 (+0000) Subject: Make the generated code for ConstantInt nicer. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4d26a0619dc73f5395e216b7c0e7bf855b954d1c;p=oota-llvm.git Make the generated code for ConstantInt nicer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35902 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm2cpp/CppWriter.cpp b/tools/llvm2cpp/CppWriter.cpp index 253375289ad..42a8560215a 100644 --- a/tools/llvm2cpp/CppWriter.cpp +++ b/tools/llvm2cpp/CppWriter.cpp @@ -694,8 +694,8 @@ void CppWriter::printConstant(const Constant *CV) { return; } if (const ConstantInt *CI = dyn_cast(CV)) { - Out << "ConstantInt* " << constName << " = ConstantInt::get(" - << "APInt(cast(" << typeName << ")->getBitWidth()," + Out << "ConstantInt* " << constName << " = ConstantInt::get(APInt(" + << cast(CI->getType())->getBitWidth() << ", " << " \"" << CI->getValue().toStringSigned(10) << "\", 10));"; } else if (isa(CV)) { Out << "ConstantAggregateZero* " << constName