diff options
-rw-r--r-- | tools/llvm2cpp/CppWriter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/llvm2cpp/CppWriter.cpp b/tools/llvm2cpp/CppWriter.cpp index 2533752..42a8560 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<ConstantInt>(CV)) { - Out << "ConstantInt* " << constName << " = ConstantInt::get(" - << "APInt(cast<IntegerType>(" << typeName << ")->getBitWidth()," + Out << "ConstantInt* " << constName << " = ConstantInt::get(APInt(" + << cast<IntegerType>(CI->getType())->getBitWidth() << ", " << " \"" << CI->getValue().toStringSigned(10) << "\", 10));"; } else if (isa<ConstantAggregateZero>(CV)) { Out << "ConstantAggregateZero* " << constName |