PGO: Statically generate data structures

Chandler Carruth chandlerc at google.com
Mon Mar 17 14:31:46 PDT 2014


On Mon, Mar 17, 2014 at 2:27 PM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:

> >> +typedef struct __llvm_pgo_data {
> >> +  const uint32_t NameSize;
> >> +  const uint32_t NumCounters;
> >> +  const char *const Name;
> >> +  const uint64_t *const Counters;
> >> +} DataType;
> >
> > It's odd that the name of this struct is nothing like the typedef. Also,
> > DataType is a pretty bad name. "struct ProfileData" is a pretty good
> > name, which you could then typedef to ProfileData if you like.
>
> Changed both names to __ProfileData.  Still using __ to guarantee nothing
> clashes with user code.  Given that this is C and we’re unlikely to
> compile compiler-rt with debug info, it may be unnecessary, but...


Why is this a better name?

In particular, I much prefer __llvm_... or __clang_... as the prefix to
ensure we're not stomping on other implementations' names...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140317/8d70c3c1/attachment.html>


More information about the cfe-commits mailing list