diff options
author | Devang Patel <dpatel@apple.com> | 2010-03-10 00:19:43 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-03-10 00:19:43 +0000 |
commit | 05c37d2800e39c2798704c865d90b5420cfca4a5 (patch) | |
tree | 86c3d3603b7b6c09e93e205e493c8817a06426b2 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 575398e29b5cfdabe4e74ea66b908d1030b86e63 (diff) | |
download | bcm5719-llvm-05c37d2800e39c2798704c865d90b5420cfca4a5.tar.gz bcm5719-llvm-05c37d2800e39c2798704c865d90b5420cfca4a5.zip |
Use SmallString instead of alloca.
llvm-svn: 98112
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 4f255ec840e..705d7f3c527 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -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 = |