[cfe-commits] r98438 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Benjamin Kramer benny.kra at googlemail.com
Sat Mar 13 04:06:51 PST 2010


Author: d0k
Date: Sat Mar 13 06:06:51 2010
New Revision: 98438

URL: http://llvm.org/viewvc/llvm-project?rev=98438&view=rev
Log:
Use raw_ostream instead of sprintf.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=98438&r1=98437&r2=98438&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Sat Mar 13 06:06:51 2010
@@ -777,9 +777,8 @@
 
   // 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 =





More information about the cfe-commits mailing list