[all-commits] [llvm/llvm-project] 330793: [libc] fix clang-tidy llvm-header-guard warnings (...

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Wed Feb 28 12:54:08 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 330793c91d08e6ac60334e4813746db898b9407e
      https://github.com/llvm/llvm-project/commit/330793c91d08e6ac60334e4813746db898b9407e
  Author: Nick Desaulniers <nickdesaulniers at users.noreply.github.com>
  Date:   2024-02-28 (Wed, 28 Feb 2024)

  Changed paths:
    M libc/include/__llvm-libc-common.h
    M libc/include/llvm-libc-macros/containerof-macro.h
    M libc/include/llvm-libc-macros/fcntl-macros.h
    M libc/include/llvm-libc-macros/features-macros.h
    M libc/include/llvm-libc-macros/fenv-macros.h
    M libc/include/llvm-libc-macros/file-seek-macros.h
    M libc/include/llvm-libc-macros/float-macros.h
    M libc/include/llvm-libc-macros/generic-error-number-macros.h
    M libc/include/llvm-libc-macros/gpu/time-macros.h
    M libc/include/llvm-libc-macros/inttypes-macros.h
    M libc/include/llvm-libc-macros/limits-macros.h
    M libc/include/llvm-libc-macros/linux/fcntl-macros.h
    M libc/include/llvm-libc-macros/linux/sched-macros.h
    M libc/include/llvm-libc-macros/linux/signal-macros.h
    M libc/include/llvm-libc-macros/linux/sys-ioctl-macros.h
    M libc/include/llvm-libc-macros/linux/sys-random-macros.h
    M libc/include/llvm-libc-macros/linux/sys-resource-macros.h
    M libc/include/llvm-libc-macros/linux/sys-socket-macros.h
    M libc/include/llvm-libc-macros/linux/sys-stat-macros.h
    M libc/include/llvm-libc-macros/linux/sys-time-macros.h
    M libc/include/llvm-libc-macros/linux/sys-wait-macros.h
    M libc/include/llvm-libc-macros/linux/termios-macros.h
    M libc/include/llvm-libc-macros/linux/time-macros.h
    M libc/include/llvm-libc-macros/linux/unistd-macros.h
    M libc/include/llvm-libc-macros/math-macros.h
    M libc/include/llvm-libc-macros/null-macro.h
    M libc/include/llvm-libc-macros/offsetof-macro.h
    M libc/include/llvm-libc-macros/sched-macros.h
    M libc/include/llvm-libc-macros/signal-macros.h
    M libc/include/llvm-libc-macros/stdckdint-macros.h
    M libc/include/llvm-libc-macros/stdfix-macros.h
    M libc/include/llvm-libc-macros/stdio-macros.h
    M libc/include/llvm-libc-macros/stdlib-macros.h
    M libc/include/llvm-libc-macros/sys-auxv-macros.h
    M libc/include/llvm-libc-macros/sys-ioctl-macros.h
    M libc/include/llvm-libc-macros/sys-mman-macros.h
    M libc/include/llvm-libc-macros/sys-queue-macros.h
    M libc/include/llvm-libc-macros/sys-random-macros.h
    M libc/include/llvm-libc-macros/sys-resource-macros.h
    M libc/include/llvm-libc-macros/sys-select-macros.h
    M libc/include/llvm-libc-macros/sys-socket-macros.h
    M libc/include/llvm-libc-macros/sys-stat-macros.h
    M libc/include/llvm-libc-macros/sys-time-macros.h
    M libc/include/llvm-libc-macros/sys-wait-macros.h
    M libc/include/llvm-libc-macros/termios-macros.h
    M libc/include/llvm-libc-macros/time-macros.h
    M libc/include/llvm-libc-macros/unistd-macros.h
    M libc/include/llvm-libc-macros/wchar-macros.h
    M libc/include/llvm-libc-types/ACTION.h
    M libc/include/llvm-libc-types/DIR.h
    M libc/include/llvm-libc-types/ENTRY.h
    M libc/include/llvm-libc-types/FILE.h
    M libc/include/llvm-libc-types/__atexithandler_t.h
    M libc/include/llvm-libc-types/__atfork_callback_t.h
    M libc/include/llvm-libc-types/__bsearchcompare_t.h
    M libc/include/llvm-libc-types/__call_once_func_t.h
    M libc/include/llvm-libc-types/__exec_argv_t.h
    M libc/include/llvm-libc-types/__exec_envp_t.h
    M libc/include/llvm-libc-types/__futex_word.h
    M libc/include/llvm-libc-types/__getoptargv_t.h
    M libc/include/llvm-libc-types/__mutex_type.h
    M libc/include/llvm-libc-types/__pthread_once_func_t.h
    M libc/include/llvm-libc-types/__pthread_start_t.h
    M libc/include/llvm-libc-types/__pthread_tss_dtor_t.h
    M libc/include/llvm-libc-types/__qsortcompare_t.h
    M libc/include/llvm-libc-types/__qsortrcompare_t.h
    M libc/include/llvm-libc-types/__sighandler_t.h
    M libc/include/llvm-libc-types/__thread_type.h
    M libc/include/llvm-libc-types/blkcnt_t.h
    M libc/include/llvm-libc-types/blksize_t.h
    M libc/include/llvm-libc-types/cc_t.h
    M libc/include/llvm-libc-types/clock_t.h
    M libc/include/llvm-libc-types/clockid_t.h
    M libc/include/llvm-libc-types/cnd_t.h
    M libc/include/llvm-libc-types/cookie_io_functions_t.h
    M libc/include/llvm-libc-types/cpu_set_t.h
    M libc/include/llvm-libc-types/dev_t.h
    M libc/include/llvm-libc-types/div_t.h
    M libc/include/llvm-libc-types/double_t.h
    M libc/include/llvm-libc-types/fd_set.h
    M libc/include/llvm-libc-types/fenv_t.h
    M libc/include/llvm-libc-types/fexcept_t.h
    M libc/include/llvm-libc-types/float128.h
    M libc/include/llvm-libc-types/float_t.h
    M libc/include/llvm-libc-types/gid_t.h
    M libc/include/llvm-libc-types/ino_t.h
    M libc/include/llvm-libc-types/jmp_buf.h
    M libc/include/llvm-libc-types/ldiv_t.h
    M libc/include/llvm-libc-types/lldiv_t.h
    M libc/include/llvm-libc-types/mode_t.h
    M libc/include/llvm-libc-types/mtx_t.h
    M libc/include/llvm-libc-types/nlink_t.h
    M libc/include/llvm-libc-types/off64_t.h
    M libc/include/llvm-libc-types/off_t.h
    M libc/include/llvm-libc-types/once_flag.h
    M libc/include/llvm-libc-types/pid_t.h
    M libc/include/llvm-libc-types/posix_spawn_file_actions_t.h
    M libc/include/llvm-libc-types/posix_spawnattr_t.h
    M libc/include/llvm-libc-types/pthread_attr_t.h
    M libc/include/llvm-libc-types/pthread_key_t.h
    M libc/include/llvm-libc-types/pthread_mutex_t.h
    M libc/include/llvm-libc-types/pthread_mutexattr_t.h
    M libc/include/llvm-libc-types/pthread_once_t.h
    M libc/include/llvm-libc-types/pthread_t.h
    M libc/include/llvm-libc-types/rlim_t.h
    M libc/include/llvm-libc-types/rpc_opcodes_t.h
    M libc/include/llvm-libc-types/sa_family_t.h
    M libc/include/llvm-libc-types/sig_atomic_t.h
    M libc/include/llvm-libc-types/siginfo_t.h
    M libc/include/llvm-libc-types/sigset_t.h
    M libc/include/llvm-libc-types/size_t.h
    M libc/include/llvm-libc-types/socklen_t.h
    M libc/include/llvm-libc-types/speed_t.h
    M libc/include/llvm-libc-types/ssize_t.h
    M libc/include/llvm-libc-types/stack_t.h
    M libc/include/llvm-libc-types/struct_dirent.h
    M libc/include/llvm-libc-types/struct_epoll_data.h
    M libc/include/llvm-libc-types/struct_epoll_event.h
    M libc/include/llvm-libc-types/struct_hsearch_data.h
    M libc/include/llvm-libc-types/struct_rlimit.h
    M libc/include/llvm-libc-types/struct_rusage.h
    M libc/include/llvm-libc-types/struct_sched_param.h
    M libc/include/llvm-libc-types/struct_sigaction.h
    M libc/include/llvm-libc-types/struct_sockaddr.h
    M libc/include/llvm-libc-types/struct_sockaddr_un.h
    M libc/include/llvm-libc-types/struct_stat.h
    M libc/include/llvm-libc-types/struct_timespec.h
    M libc/include/llvm-libc-types/struct_timeval.h
    M libc/include/llvm-libc-types/struct_tm.h
    M libc/include/llvm-libc-types/struct_utsname.h
    M libc/include/llvm-libc-types/suseconds_t.h
    M libc/include/llvm-libc-types/tcflag_t.h
    M libc/include/llvm-libc-types/test_rpc_opcodes_t.h
    M libc/include/llvm-libc-types/thrd_start_t.h
    M libc/include/llvm-libc-types/thrd_t.h
    M libc/include/llvm-libc-types/time_t.h
    M libc/include/llvm-libc-types/tss_dtor_t.h
    M libc/include/llvm-libc-types/tss_t.h
    M libc/include/llvm-libc-types/uid_t.h
    M libc/include/llvm-libc-types/union_sigval.h
    M libc/include/llvm-libc-types/wchar_t.h
    M libc/include/llvm-libc-types/wint_t.h
    M libc/include/sys/queue.h
    M libc/src/__support/CPP/type_traits/is_fixed_point.h
    M libc/src/__support/FPUtil/fpbits_str.h
    M libc/src/__support/GPU/generic/utils.h
    M libc/src/__support/GPU/utils.h
    M libc/src/__support/HashTable/table.h
    M libc/src/__support/OSUtil/gpu/io.h
    M libc/src/__support/RPC/rpc_util.h
    M libc/src/__support/StringUtil/message_mapper.h
    M libc/src/__support/StringUtil/platform_errors.h
    M libc/src/__support/StringUtil/platform_signals.h
    M libc/src/__support/StringUtil/tables/linux_extension_errors.h
    M libc/src/__support/StringUtil/tables/linux_extension_signals.h
    M libc/src/__support/StringUtil/tables/linux_platform_errors.h
    M libc/src/__support/StringUtil/tables/linux_platform_signals.h
    M libc/src/__support/StringUtil/tables/minimal_platform_errors.h
    M libc/src/__support/StringUtil/tables/minimal_platform_signals.h
    M libc/src/__support/StringUtil/tables/posix_errors.h
    M libc/src/__support/StringUtil/tables/posix_signals.h
    M libc/src/__support/StringUtil/tables/signal_table.h
    M libc/src/__support/StringUtil/tables/stdc_errors.h
    M libc/src/__support/StringUtil/tables/stdc_signals.h
    M libc/src/__support/fixed_point/fx_bits.h
    M libc/src/__support/fixed_point/fx_rep.h
    M libc/src/__support/memory_size.h
    M libc/src/__support/threads/gpu/mutex.h
    M libc/src/assert/assert.h
    M libc/src/gpu/rpc_host_call.h
    M libc/src/math/amdgpu/declarations.h
    M libc/src/math/amdgpu/platform.h
    M libc/src/math/copysignf128.h
    M libc/src/math/generic/exp_utils.h
    M libc/src/math/nvptx/declarations.h
    M libc/src/math/nvptx/nvptx.h
    M libc/src/search/hsearch/global.h
    M libc/src/string/memory_utils/aarch64/inline_memcpy.h
    M libc/src/string/memory_utils/riscv/inline_memmove.h
    M libc/test/UnitTest/ExecuteFunction.h
    M libc/test/UnitTest/FPExceptMatcher.h
    M libc/test/UnitTest/FPMatcher.h
    M libc/test/UnitTest/LibcTest.h
    M libc/test/UnitTest/MemoryMatcher.h
    M libc/test/UnitTest/PlatformDefs.h
    M libc/test/UnitTest/RoundingModeUtils.h
    M libc/test/UnitTest/StringUtils.h
    M libc/test/UnitTest/Test.h
    M libc/test/integration/src/spawn/test_binary_properties.h
    M libc/test/src/math/FAbsTest.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/RandUtils.h
    M libc/test/src/math/RoundTest.h
    M libc/test/src/math/TruncTest.h
    M libc/test/src/math/differential_testing/Timer.h
    M libc/test/src/math/in_float_range_test_helper.h
    M libc/test/src/math/smoke/CeilTest.h
    M libc/test/src/math/smoke/CopySignTest.h
    M libc/test/src/math/smoke/FAbsTest.h
    M libc/test/src/math/smoke/FMaxTest.h
    M libc/test/src/math/smoke/FMinTest.h
    M libc/test/src/math/smoke/FloorTest.h
    M libc/test/src/math/smoke/RIntTest.h
    M libc/test/src/math/smoke/RoundTest.h
    M libc/test/src/math/smoke/RoundToIntegerTest.h
    M libc/test/src/math/smoke/TruncTest.h
    M libc/test/src/time/TmHelper.h
    M libc/utils/MPFRWrapper/MPFRUtils.h

  Log Message:
  -----------
  [libc] fix clang-tidy llvm-header-guard warnings (#82679)


Towards the goal of getting `ninja libc-lint` back to green, fix the numerous
instances of:

    warning: header guard does not follow preferred style [llvm-header-guard]

This is because many of our header guards start with `__LLVM` rather than
`LLVM`.

To filter just these warnings:

    $ ninja -k2000 libc-lint 2>&1 | grep llvm-header-guard

To automatically apply fixits:

    $ find libc/src libc/include libc/test -name \*.h | \
        xargs -n1 -I {} clang-tidy {} -p build/compile_commands.json \
        -checks='-*,llvm-header-guard' --fix --quiet

Some manual cleanup is still necessary as headers that were missing header
guards outright will have them inserted before the license block (we prefer
them after).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list