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 | f33837022e000c383527fa560d4b5381b6563fcd (patch) | |
tree | 46aa8eb37145bea1cf5e7f9a09197b2f145a22f1 /lib/CodeGen/CGDebugInfo.cpp | |
parent | 2cfe28b6a061e72c6c8726d7ecb879093a1ab7a3 (diff) |
Use SmallString instead of alloca.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98112 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 4f255ec840..705d7f3c52 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/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 = |