[llvm-commits] [PATCH] Replace uses of strcpy and memcpy in llvm-nm.cpp

Chris Lattner clattner at apple.com
Fri Oct 12 11:01:06 PDT 2012


On Oct 11, 2012, at 8:50 PM, "Martinez, Javier E" <javier.e.martinez at intel.com> wrote:

> Hi Dmitri,
> 
> Sorry for the delay but here's a revised patch. Please review.

This code is no more correct or safe than the code it is replacing.  It is also substantially more complicated and slow.

-Chris

> 
> Thanks,
> Javier
> 
> -----Original Message-----
> From: Dmitri Gribenko [mailto:gribozavr at gmail.com] 
> Sent: Saturday, October 06, 2012 6:37 AM
> To: Martinez, Javier E
> Cc: llvm-commits at cs.uiuc.edu
> Subject: Re: [llvm-commits] [PATCH] Replace uses of strcpy and memcpy in llvm-nm.cpp
> 
> On Wed, Oct 3, 2012 at 9:55 AM, Martinez, Javier E <javier.e.martinez at intel.com> wrote:
>> Hello,
>> 
>> This patch is to remove the use of strcpy in llvm-nm.cpp and replace 
>> it with format objects. Please review and commit if it looks good.
> 
> Saving format objects somewhere instead of using them directly  with the raw_ostream contradicts the design intent of raw_ostream and makes the code more complicated than it was before.
> 
> Dmitri
> 
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
> <llvm-nm.cpp.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list