From f3fd36e590f4ca36e466801bee40497714df895c Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Wed, 9 Jun 2021 11:09:19 +0100 Subject: [PATCH] JSONNodeDumper.cpp - VisitIntegerLiteral - avoid APSInt::toString std::string wrapper. NFCI Pulled out of D103888 - use the underlying SmallString version directly --- clang/lib/AST/JSONNodeDumper.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/clang/lib/AST/JSONNodeDumper.cpp b/clang/lib/AST/JSONNodeDumper.cpp index d283558..038acee 100644 --- a/clang/lib/AST/JSONNodeDumper.cpp +++ b/clang/lib/AST/JSONNodeDumper.cpp @@ -1414,9 +1414,10 @@ void JSONNodeDumper::VisitCXXDependentScopeMemberExpr( } void JSONNodeDumper::VisitIntegerLiteral(const IntegerLiteral *IL) { - JOS.attribute("value", - IL->getValue().toString( - /*Radix=*/10, IL->getType()->isSignedIntegerType())); + llvm::SmallString<16> Buffer; + IL->getValue().toString(Buffer, + /*Radix=*/10, IL->getType()->isSignedIntegerType()); + JOS.attribute("value", Buffer); } void JSONNodeDumper::VisitCharacterLiteral(const CharacterLiteral *CL) { // FIXME: This should probably print the character literal as a string, -- 2.7.4