CodingStandards: restrict CamelCase variable names guideline to llvm/clang/clang...
authorFangrui Song <i@maskray.me>
Wed, 28 Dec 2022 20:48:13 +0000 (12:48 -0800)
committerFangrui Song <i@maskray.me>
Wed, 28 Dec 2022 20:48:13 +0000 (12:48 -0800)
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. lldb uses snake_case.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D140585

llvm/docs/CodingStandards.rst

index 0f30594..b6225b9 100644 (file)
@@ -1112,8 +1112,10 @@ In general, names should be in camel case (e.g. ``TextFileReader`` and
   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``); start with a lower case-letter 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,