[LLVMdev] lld coding style

Sean Silva chisophugis at gmail.com
Thu Oct 9 17:59:16 PDT 2014


On Thu, Oct 9, 2014 at 2:17 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:

> On Thu, Oct 9, 2014 at 3:31 AM, Chandler Carruth <chandlerc at google.com>
> wrote:
> >
> > On Wed, Oct 8, 2014 at 7:20 PM, Nick Kledzik <kledzik at apple.com> wrote:
> >>
> >> The lld conventions for ivars is a leading underscore followed by a
> >> lowercase letter.  The reserved identifiers are a leading underscore
> >> followed by an uppercase letter.  There is no conflict.
> >
> >
> > And I didn't say that there was. They are *close*. Too close. People make
> > mistakes and get it wrong.
>
> I like how LLD style improves upon LLVM style, but the concern about
> reserved identifiers is very real.  May I suggest a variation: use a
> trailing underscore for member variables instead of a trailing
> underscore?
>
>
I've been bitten by the following autocomplete:

struct Foo {
  Foo(int count) : count_(count_) {}
  int count_;
};

When this happened to me, it was very difficult to track down. Now, we
might have a warning that protects against that though.

-- Sean Silva


> 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 Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141009/ce51259e/attachment.html>


More information about the llvm-dev mailing list