diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 5 |
1 files 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<Decl>(RD->getDeclContext()), Unit); llvm::DICompositeType FwdDecl = |