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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 28 12:48:18 PST 2022


Author: Fangrui Song
Date: 2022-12-28T12:48:13-08:00
New Revision: ee9ccb11036ac46ff9b9f3fa2d459d9d2bce5509

URL: https://github.com/llvm/llvm-project/commit/ee9ccb11036ac46ff9b9f3fa2d459d9d2bce5509
DIFF: https://github.com/llvm/llvm-project/commit/ee9ccb11036ac46ff9b9f3fa2d459d9d2bce5509.diff

LOG: CodingStandards: restrict CamelCase variable names guideline to llvm/clang/clang-tools-extra/polly/bolt

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

Added: 
    

Modified: 
    llvm/docs/CodingStandards.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/CodingStandards.rst b/llvm/docs/CodingStandards.rst
index 0f30594267016..b6225b9fcaa0a 100644
--- a/llvm/docs/CodingStandards.rst
+++ b/llvm/docs/CodingStandards.rst
@@ -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,


        


More information about the llvm-commits mailing list