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

Devang Patel dpatel at apple.com
Tue Mar 9 16:19:43 PST 2010


Author: dpatel
Date: Tue Mar  9 18:19:43 2010
New Revision: 98112

URL: http://llvm.org/viewvc/llvm-project?rev=98112&view=rev
Log:
Use SmallString instead of alloca.

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=98112&r1=98111&r2=98112&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Tue Mar  9 18:19:43 2010
@@ -774,8 +774,9 @@
 
   // A RD->getName() is not unique. However, the debug info descriptors 
   // are uniqued so use type name to ensure uniquness.
-  char *FwdDeclName = (char *)alloca(65);
-  sprintf(FwdDeclName, "fwd.type.%d", FwdDeclCount++);
+  llvm::SmallString<256> FwdDeclName;
+  FwdDeclName.resize(256);
+  sprintf(&FwdDeclName[0], "fwd.type.%d", FwdDeclCount++);
   llvm::DIDescriptor FDContext = 
     getContextDescriptor(dyn_cast<Decl>(RD->getDeclContext()), Unit);
   llvm::DICompositeType FwdDecl =





More information about the cfe-commits mailing list