[PATCH] D140585: CodingStandards: restrict CamelCase variable names guideline to llvm/clang/clang-tools-extra/polly/bolt

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 22 13:19:25 PST 2022


MaskRay created this revision.
MaskRay added reviewers: dblaikie, maksfb, mehdi_amini, nhaehnle, wingo.
Herald added a reviewer: bollu.
Herald added subscribers: bzcheeseman, StephenFan, rriddle.
Herald added a project: All.
MaskRay requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, sstefan1, stephenneuendorffer.
Herald added a project: LLVM.

See https://discourse.llvm.org/t/top-level-clang-tidy-options-and-variablename-suggestion-on-codingstandards/58783 ,
the CamelCase variable names guideline does not reflect the truth:
flang, libc, libclc, libcxx, libcxxabi, libunwind, lld, mlir, openmp,
and pstl use camelCase.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140585

Files:
  llvm/docs/CodingStandards.rst


Index: llvm/docs/CodingStandards.rst
===================================================================
--- llvm/docs/CodingStandards.rst
+++ llvm/docs/CodingStandards.rst
@@ -1112,8 +1112,9 @@
   nouns and start with an upper-case letter (e.g. ``TextFileReader``).
 
 * **Variable names** should be nouns (as they represent state).  The name should
-  be camel case, and start with an upper case letter (e.g. ``Leader`` or
-  ``Boats``).
+  be camel case.  In llvm/, clang/, clang-tools-extra/, polly/, and bolt/,
+  the name should start with an upper case letter (e.g. ``Leader`` or
+  ``Boats``); lower case letter for other directories.
 
 * **Function names** should be verb phrases (as they represent actions), and
   command-like function should be imperative.  The name should be camel case,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140585.484953.patch
Type: text/x-patch
Size: 802 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221222/7df8be0a/attachment.bin>


More information about the llvm-commits mailing list