]> granicus.if.org Git - clang/commitdiff
Use SmallString instead of alloca.
authorDevang Patel <dpatel@apple.com>
Wed, 10 Mar 2010 00:19:43 +0000 (00:19 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 10 Mar 2010 00:19:43 +0000 (00:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98112 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 4f255ec840eea62b5987621b53554fba899d1369..705d7f3c5274bc61ecdbdb376634244ca98a72e3 100644 (file)
@@ -774,8 +774,9 @@ 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.
-  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 =