[llvm-dev] changing variable naming rules in LLVM codebase

Alex Denisov via llvm-dev llvm-dev at lists.llvm.org
Mon Feb 11 12:23:32 PST 2019


Just to add another data point: I’m pretty much in love with the lowerCamelCase.
To be more objective: I’ve such code across LLVM’s code base:

    class Dragon {};
    /// ...
    Dragon Dragon;

Which compiles correctly, but debuggers get confused when you ask them to do any actions on Dragon: they could not differentiate between variable and class*.

* not sure if that’s still the case with the recent versions of gdb/lldb, but it was caused some problems while debugging in the past.

> On 8. Feb 2019, at 16:41, via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> An excellent first step toward improving our naming style, I'm all for it.  Very much tired of circumlocutions like "Triple TheTriple;".
> --paulr
>  
> From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Michael Platings via llvm-dev
> Sent: Thursday, February 07, 2019 5:11 PM
> To: llvm-dev at lists.llvm.org
> Cc: nd
> Subject: [llvm-dev] RFC: changing variable naming rules in LLVM codebase
>  
> TL;DR: change the rule for variable names from UpperCamelCase to lowerCamelCase.
>  
> Just to get wider visibility on this, I'm raising this again as an RFC, as suggested by Roman Lebedev.
>  
> My original post from last week is here and gives a rationale: http://lists.llvm.org/pipermail/llvm-dev/2019-February/129854.html. There seemed to be general agreement that the status quo is not ideal.
>  
> Chris Lattner pointed out that this came up in 2014 as well: http://lists.llvm.org/pipermail/llvm-dev/2014-October/077685.html
>  
> I've created a patch to implement the change. Review and comments welcome: https://reviews.llvm.org/D57896
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list