[llvm-dev] RFC: changing variable naming rules in LLVM codebase
Michael Platings via llvm-dev
llvm-dev at lists.llvm.org
Mon Feb 18 02:15:58 PST 2019
Regarding a plan for conversion, I'm keen to avoid perfect being the enemy of better.
Privately, people I've spoken with have told me that they're opposed to a large scale conversion. Reasons given include breaking git blame, and creating needless merge conflicts. I might be wrong, but the evidence I've seen suggests that it's going to be very hard to get consensus on a conversion.
So what's worse: inconsistent capitalization or keeping a convention that discourages good naming?
Taking my previous example :
InnerLoopVectorizer LB(L, PSE, LI, DT, TLI, TTI, AC, ORE, VF.Width, IC,
If we imagine that over time it evolves such that 50% of the variables have been renamed to camelBack versions of the type names, then it will look like this:
InnerLoopVectorizer LB(loop, PSE, loopInfo, DT, targetLibraryInfo, TTI,
assumptionCache, ORE, vectorizationFactor.Width, IC,
Yes it's inconsistent, but IMHO it still conveys so much more information than the original that the benefit greatly outweighs the cost.
So is the disruption implied by changing to the new convention justified? I think so.
More information about the llvm-dev