From 70053c340e41a1a7086ecef218395489b3c8cbc6 Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Mon, 18 Aug 2008 20:03:45 +0000 Subject: [PATCH] Unbreak cpp backend: upgrade output due to change in APInt API git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54942 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/CppBackend/CPPBackend.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index b359659bcdf..fc5be988280 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -732,9 +732,10 @@ namespace { return; } if (const ConstantInt *CI = dyn_cast(CV)) { + std::string constValue = CI->getValue().toString(10, true); Out << "ConstantInt* " << constName << " = ConstantInt::get(APInt(" << cast(CI->getType())->getBitWidth() << ", \"" - << CI->getValue() << "\", 10));"; + << constValue << "\", " << constValue.length() << ", 10));"; } else if (isa(CV)) { Out << "ConstantAggregateZero* " << constName << " = ConstantAggregateZero::get(" << typeName << ");";