On Fri, Jun 17, 2011 at 09:45:51PM -0700, Chris Lattner wrote: > > On Jun 17, 2011, at 4:57 PM, John McCall wrote: > > > As a general note, this looks pretty good; I just have a few organizational > > and data-structure comments. > > > > diff --git a/lib/CodeGen/CGAnnotations.cpp b/lib/CodeGen/CGAnnotations.cpp > > > > +static const char *AnnotationSection = "llvm.metadata"; > > > > This should be a #define; every single place you use this in the file ends > > up having to call strlen completely unnecessarily. > > FYI, the optimizer folds strlen of constant strings. This would be preferred > though: > > static const char * const AnnotationSection = "llvm.metadata";
Even better: static const char AnnotationSection[] = "llvm.metadata"; ...in which case strlen() can be substituted with sizeof-1. Joerg _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
