[all-commits] [llvm/llvm-project] 43e2f7: [libc] update tidy rules to fix variable formatting

michaelrj-google via All-commits all-commits at lists.llvm.org
Tue Dec 7 10:49:59 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 43e2f7cd248acf799bf97af2388940c9c39151e0
      https://github.com/llvm/llvm-project/commit/43e2f7cd248acf799bf97af2388940c9c39151e0
  Author: Michael Jones <michaelrj at google.com>
  Date:   2021-12-07 (Tue, 07 Dec 2021)

  Changed paths:
    M libc/CMakeLists.txt
    M libc/cmake/modules/LLVMLibCObjectRules.cmake
    M libc/src/.clang-tidy
    A libc/src/__support/CPP/.clang-tidy

  Log Message:
  -----------
  [libc] update tidy rules to fix variable formatting

This commit changes the clang-tidy rules for LLVM-libc to follow the new
format. The next commit applies these rules to the codebase.

The rules are as follows:

CamelCase for classes
lower_case for variables
lower_case for functions
UPPER_CASE for constexpr variables

There are also some exceptions, but the most important one is that any
function or variable that starts with an underscore is exempt from the
formatting.

Reviewed By: sivachandra, lntue

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


  Commit: 1c92911e9e1d503c0dfc4367da7f15d0dff50587
      https://github.com/llvm/llvm-project/commit/1c92911e9e1d503c0dfc4367da7f15d0dff50587
  Author: Michael Jones <michaelrj at google.com>
  Date:   2021-12-07 (Tue, 07 Dec 2021)

  Changed paths:
    M libc/benchmarks/automemcpy/lib/CodeGen.cpp
    M libc/benchmarks/automemcpy/unittests/CodeGenTest.cpp
    M libc/fuzzing/math/Compare.h
    M libc/src/__support/CPP/Bitset.h
    M libc/src/__support/FPUtil/BasicOperations.h
    M libc/src/__support/FPUtil/DivisionAndRemainderOperations.h
    M libc/src/__support/FPUtil/FEnvImpl.h
    M libc/src/__support/FPUtil/FPBits.h
    M libc/src/__support/FPUtil/FloatProperties.h
    M libc/src/__support/FPUtil/Hypot.h
    M libc/src/__support/FPUtil/ManipulationFunctions.h
    M libc/src/__support/FPUtil/NearestIntegerOperations.h
    M libc/src/__support/FPUtil/NormalFloat.h
    M libc/src/__support/FPUtil/Sqrt.h
    M libc/src/__support/FPUtil/aarch64/FEnvImpl.h
    M libc/src/__support/FPUtil/generic/FMA.h
    M libc/src/__support/FPUtil/x86_64/FEnvImpl.h
    M libc/src/__support/FPUtil/x86_64/LongDoubleBits.h
    M libc/src/__support/FPUtil/x86_64/NextAfterLongDouble.h
    M libc/src/__support/FPUtil/x86_64/SqrtLongDouble.h
    M libc/src/__support/detailed_powers_of_ten.h
    M libc/src/__support/endian.h
    M libc/src/__support/high_precision_decimal.h
    M libc/src/__support/integer_operations.h
    M libc/src/__support/str_to_float.h
    M libc/src/__support/str_to_integer.h
    M libc/src/assert/__assert_fail.cpp
    M libc/src/errno/__errno_location.cpp
    M libc/src/fenv/feclearexcept.cpp
    M libc/src/fenv/fedisableexcept.cpp
    M libc/src/fenv/feenableexcept.cpp
    M libc/src/fenv/fegetenv.cpp
    M libc/src/fenv/fegetexcept.cpp
    M libc/src/fenv/fegetexceptflag.cpp
    M libc/src/fenv/fegetround.cpp
    M libc/src/fenv/feholdexcept.cpp
    M libc/src/fenv/feraiseexcept.cpp
    M libc/src/fenv/fesetenv.cpp
    M libc/src/fenv/fesetexceptflag.cpp
    M libc/src/fenv/fesetround.cpp
    M libc/src/fenv/fetestexcept.cpp
    M libc/src/fenv/feupdateenv.cpp
    M libc/src/inttypes/imaxdiv.cpp
    M libc/src/math/generic/cosf.cpp
    M libc/src/math/generic/dp_trig.cpp
    M libc/src/math/generic/expm1f.cpp
    M libc/src/math/generic/llrint.cpp
    M libc/src/math/generic/llrintf.cpp
    M libc/src/math/generic/llrintl.cpp
    M libc/src/math/generic/llround.cpp
    M libc/src/math/generic/llroundf.cpp
    M libc/src/math/generic/llroundl.cpp
    M libc/src/math/generic/lrint.cpp
    M libc/src/math/generic/lrintf.cpp
    M libc/src/math/generic/lrintl.cpp
    M libc/src/math/generic/lround.cpp
    M libc/src/math/generic/lroundf.cpp
    M libc/src/math/generic/lroundl.cpp
    M libc/src/math/generic/math_utils.h
    M libc/src/math/generic/nearbyint.cpp
    M libc/src/math/generic/nearbyintf.cpp
    M libc/src/math/generic/nearbyintl.cpp
    M libc/src/math/generic/rint.cpp
    M libc/src/math/generic/rintf.cpp
    M libc/src/math/generic/rintl.cpp
    M libc/src/math/generic/sincosf.cpp
    M libc/src/math/generic/sincosf_data.cpp
    M libc/src/math/generic/sincosf_utils.h
    M libc/src/math/generic/sinf.cpp
    M libc/src/signal/linux/sigaction.cpp
    M libc/src/signal/linux/sigemptyset.cpp
    M libc/src/signal/linux/signal.h
    M libc/src/stdlib/abs.cpp
    M libc/src/stdlib/div.cpp
    M libc/src/stdlib/labs.cpp
    M libc/src/stdlib/ldiv.cpp
    M libc/src/stdlib/llabs.cpp
    M libc/src/stdlib/lldiv.cpp
    M libc/src/string/memccpy.cpp
    M libc/src/string/memmove.cpp
    M libc/src/string/memory_utils/bcmp_implementations.h
    M libc/src/string/memory_utils/elements.h
    M libc/src/string/memory_utils/elements_aarch64.h
    M libc/src/string/memory_utils/elements_x86.h
    M libc/src/string/memory_utils/memcmp_implementations.h
    M libc/src/string/memory_utils/memcpy_implementations.h
    M libc/src/string/memory_utils/memset_implementations.h
    M libc/src/string/strcat.cpp
    M libc/src/string/strncat.cpp
    M libc/src/threads/linux/Thread.h
    M libc/src/threads/linux/thrd_create.cpp
    M libc/src/threads/linux/thrd_join.cpp
    M libc/src/time/asctime.cpp
    M libc/src/time/asctime_r.cpp
    M libc/src/time/mktime.cpp
    M libc/src/time/time_utils.cpp
    M libc/src/time/time_utils.h
    M libc/test/src/__support/endian_test.cpp
    M libc/test/src/__support/high_precision_decimal_test.cpp
    M libc/test/src/__support/str_to_float_test.cpp
    M libc/test/src/fenv/enabled_exceptions_test.cpp
    M libc/test/src/fenv/exception_flags_test.cpp
    M libc/test/src/fenv/exception_status_test.cpp
    M libc/test/src/fenv/feclearexcept_test.cpp
    M libc/test/src/fenv/feholdexcept_test.cpp
    M libc/test/src/fenv/feupdateenv_test.cpp
    M libc/test/src/fenv/getenv_and_setenv_test.cpp
    M libc/test/src/math/CeilTest.h
    M libc/test/src/math/CopySignTest.h
    M libc/test/src/math/FAbsTest.h
    M libc/test/src/math/FDimTest.h
    M libc/test/src/math/FMaxTest.h
    M libc/test/src/math/FMinTest.h
    M libc/test/src/math/FloorTest.h
    M libc/test/src/math/FmaTest.h
    M libc/test/src/math/FrexpTest.h
    M libc/test/src/math/HypotTest.h
    M libc/test/src/math/ILogbTest.h
    M libc/test/src/math/LdExpTest.h
    M libc/test/src/math/LogbTest.h
    M libc/test/src/math/ModfTest.h
    M libc/test/src/math/NextAfterTest.h
    M libc/test/src/math/RIntTest.h
    M libc/test/src/math/RemQuoTest.h
    M libc/test/src/math/RoundTest.h
    M libc/test/src/math/RoundToIntegerTest.h
    M libc/test/src/math/SqrtTest.h
    M libc/test/src/math/TruncTest.h
    M libc/test/src/math/cosf_test.cpp
    M libc/test/src/math/exhaustive/expm1f_test.cpp
    M libc/test/src/math/exp2f_test.cpp
    M libc/test/src/math/expf_test.cpp
    M libc/test/src/math/expm1f_test.cpp
    M libc/test/src/math/sincosf_test.cpp
    M libc/test/src/math/sinf_test.cpp
    M libc/test/src/stdlib/atof_test.cpp
    M libc/test/src/stdlib/strtod_test.cpp
    M libc/test/src/stdlib/strtof_test.cpp
    M libc/test/src/string/memory_utils/elements_test.cpp
    M libc/test/src/string/memory_utils/memory_access_test.cpp
    M libc/test/src/time/TmHelper.h
    M libc/test/src/time/asctime_r_test.cpp
    M libc/test/src/time/gmtime_r_test.cpp
    M libc/test/src/time/gmtime_test.cpp
    M libc/test/src/time/mktime_test.cpp
    M libc/test/utils/FPUtil/x86_long_double_test.cpp
    M libc/utils/MPFRWrapper/MPFRUtils.cpp
    M libc/utils/UnitTest/FPMatcher.cpp
    M libc/utils/UnitTest/FPMatcher.h

  Log Message:
  -----------
  [libc] apply new lint rules

This patch applies the lint rules described in the previous patch. There
was also a significant amount of effort put into manually fixing things,
since all of the templated functions, or structs defined in /spec, were
not updated and had to be handled manually.

Reviewed By: sivachandra, lntue

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


Compare: https://github.com/llvm/llvm-project/compare/b5c42ef3da4d...1c92911e9e1d


More information about the All-commits mailing list