[cfe-commits] r98112 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Daniel Dunbar
daniel at zuster.org
Wed Mar 10 11:46:35 PST 2010
Hi Devang,
Can you use raw_ostream instead of resize + sprintf please? Tx!
- Daniel
On Tue, Mar 9, 2010 at 4:19 PM, Devang Patel <dpatel at apple.com> wrote:
> 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 =
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
More information about the cfe-commits
mailing list