From fea3d4dd1a0cebafba7d85cfcb1724b644e2b8e2 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 13 Mar 2010 12:06:51 +0000 Subject: [PATCH] Use raw_ostream instead of sprintf. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98438 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 925453a678..60aa4e784e 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -777,9 +777,8 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty, // A RD->getName() is not unique. However, the debug info descriptors // are uniqued so use type name to ensure uniquness. - llvm::SmallString<256> FwdDeclName; - FwdDeclName.resize(256); - sprintf(&FwdDeclName[0], "fwd.type.%d", FwdDeclCount++); + llvm::SmallString<128> FwdDeclName; + llvm::raw_svector_ostream(FwdDeclName) << "fwd.type." << FwdDeclCount++; llvm::DIDescriptor FDContext = getContextDescriptor(dyn_cast(RD->getDeclContext()), Unit); llvm::DICompositeType FwdDecl = -- 2.40.0