pytorch/torch/csrc/utils
cyy 8fa81a6066 Enable misc-use-internal-linkage check and apply fixes (#148948)
Enables clang-tidy rule [`misc-use-internal-linkage`](https://clang.llvm.org/extra/clang-tidy/checks/misc/use-internal-linkage.html). This new check was introduced in Clang-Tidy 18 and is available due to recent update of Clang-Tidy 19.

The check marks functions and variables used only in the translation unit as static. Therefore undesired symbols are not leaked into other units, more link time optimisations are possible and the resulting binaries may be smaller.

The detected violations were mostly fixed by using static. In other cases, the symbols were indeed consumed by others files, then their declaring headers were included. Still some declarations were wrong and have been fixed.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/148948
Approved by: https://github.com/Skylion007
2025-03-12 14:22:56 +00:00
..
byte_order.cpp
byte_order.h
cpp_stacktraces.cpp [Reland][Environment Variable][4/N] Use thread-safe getenv functions (#140593) 2025-01-28 20:51:49 +00:00
cpp_stacktraces.h
cuda_enabled.h
device_lazy_init.cpp
device_lazy_init.h expose extra torch_python apis (#144746) 2025-01-16 20:50:31 +00:00
disable_torch_function.cpp Enable misc-use-internal-linkage check and apply fixes (#148948) 2025-03-12 14:22:56 +00:00
disable_torch_function.h
generated_serialization_types.h [export] Sync aoti schema to schema.py (#148017) 2025-02-27 21:46:11 +00:00
init.cpp
init.h
invalid_arguments.cpp Enable more readability-redundant checks (#143963) 2024-12-30 14:49:33 +00:00
invalid_arguments.h
nested.cpp
nested.h
numpy_stub.h
object_ptr.cpp Expose several APIs to public (torch python APIs) (#144525) 2025-01-15 14:34:45 +00:00
object_ptr.h dynamo tracing perf: c++ strip_function_call: 49.12 -> 47.77 (#143063) 2024-12-22 06:38:46 +00:00
out_types.cpp [3/N] Apply bugprone-unchecked-optional-access (#142442) 2024-12-11 01:39:10 +00:00
out_types.h
pybind.cpp [3/N] Apply bugprone-unchecked-optional-access (#142442) 2024-12-11 01:39:10 +00:00
pybind.h
pycfunction_helpers.h
pyobject_preservation.cpp
pyobject_preservation.h
python_arg_parser.cpp Use std::string_view (#145906) 2025-01-30 03:14:27 +00:00
python_arg_parser.h Expose functions used in custom backend in torch_python dll (#148213) 2025-03-07 02:34:37 +00:00
python_compat.h Enable readability-redundant-declaration (#143982) 2024-12-31 00:20:10 +00:00
python_dispatch.cpp Enable misc-use-internal-linkage check and apply fixes (#148948) 2025-03-12 14:22:56 +00:00
python_dispatch.h
python_numbers.h
python_raii.h
python_scalars.h add the torch.float8_e8m0fnu dtype to PyTorch (#147466) 2025-02-20 13:55:42 +00:00
python_strings.h
python_stub.h
python_symnode.cpp
python_symnode.h
python_torch_function_mode.h
python_tuples.h
pythoncapi_compat.h
schema_info.cpp
schema_info.h
six.h
structseq.cpp
structseq.h
tensor_apply.cpp
tensor_apply.h
tensor_dtypes.cpp
tensor_dtypes.h
tensor_flatten.cpp
tensor_flatten.h
tensor_layouts.cpp
tensor_layouts.h
tensor_list.cpp
tensor_list.h
tensor_memoryformats.cpp
tensor_memoryformats.h
tensor_new.cpp Enable misc-use-internal-linkage check and apply fixes (#148948) 2025-03-12 14:22:56 +00:00
tensor_new.h Expose several APIs to public (torch python APIs) (#144525) 2025-01-15 14:34:45 +00:00
tensor_numpy.cpp Enable misc-use-internal-linkage check and apply fixes (#148948) 2025-03-12 14:22:56 +00:00
tensor_numpy.h
tensor_qschemes.cpp
tensor_qschemes.h
tensor_types.cpp [4/N] Remove unnecessary once flag usage (#146783) 2025-02-11 13:55:06 +00:00
tensor_types.h
throughput_benchmark-inl.h Fix Throughputbenchmark issue (#144669) 2025-01-26 03:37:20 +00:00
throughput_benchmark.cpp [19/N] Fix extra warnings brought by clang-tidy-17 (#144448) 2025-01-09 15:58:05 +00:00
throughput_benchmark.h Enable more readability-redundant checks (#143963) 2024-12-30 14:49:33 +00:00
torch_dispatch_mode.h
variadic.cpp
variadic.h
verbose.cpp
verbose.h