Skip to content

Commit 69c0b2f

Browse files
authored
[libc][NFC] Remove all trailing spaces from libc (llvm#82831)
Summary: There are a lot of random training spaces on various lines. This patch just got rid of all of them with `sed 's/\ \+$//g'.
1 parent 2594095 commit 69c0b2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+229
-229
lines changed

libc/AOR_v20.02/string/arm/memchr.S

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ __memchr_arm:
4949
and r1,r1,#0xff @ Don't think we can trust the caller to actually pass a char
5050

5151
cmp r2,#16 @ If it's short don't bother with anything clever
52-
blt 20f
52+
blt 20f
5353

5454
tst r0, #7 @ If it's already aligned skip the next bit
5555
beq 10f
@@ -62,7 +62,7 @@ __memchr_arm:
6262
beq 50f @ If it matches exit found
6363
tst r0, #7
6464
bne 5b @ If not aligned yet then do next byte
65-
65+
6666
10:
6767
@ At this point, we are aligned, we know we have at least 8 bytes to work with
6868
push {r4,r5,r6,r7}
@@ -71,7 +71,7 @@ __memchr_arm:
7171
bic r4, r2, #7 @ Number of double words to work with
7272
mvns r7, #0 @ all F's
7373
movs r3, #0
74-
74+
7575
15:
7676
ldmia r0!,{r5,r6}
7777
subs r4, r4, #8
@@ -87,7 +87,7 @@ __memchr_arm:
8787
pop {r4,r5,r6,r7}
8888
and r1,r1,#0xff @ Get r1 back to a single character from the expansion above
8989
and r2,r2,#7 @ Leave the count remaining as the number after the double words have been done
90-
90+
9191
20:
9292
cbz r2, 40f @ 0 length or hit the end already then not found
9393

libc/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ elseif(LIBC_CMAKE_VERBOSE_LOGGING)
162162
message(STATUS "Path for config files is: ${LIBC_CONFIG_PATH}")
163163
endif()
164164

165-
# option(LIBC_ENABLE_WIDE_CHARACTERS
165+
# option(LIBC_ENABLE_WIDE_CHARACTERS
166166
# "Whether to enable wide character functions on supported platforms. This may
167167
# also set flags to enable or disable wide character support within other
168168
# functions (e.g. printf)." ON)

libc/benchmarks/automemcpy/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ git clone https://github.com/Z3Prover/z3.git
1717
python scripts/mk_make.py --prefix=<Z3_INSTALL_DIR>
1818
cd build
1919
make -j
20-
make install
20+
make install
2121
```
2222

2323
## Configuration
@@ -68,7 +68,7 @@ Make sure to save the results of the benchmark as a json file.
6868
By default, each function is benchmarked for at least one second, here we lower it to 200ms.
6969

7070
- `--benchmark_filter="BM_Memset|BM_Bzero"`
71-
71+
7272
By default, all functions are benchmarked, here we restrict them to `memset` and `bzero`.
7373

7474
Other options might be useful, use `--help` for more information.

libc/cmake/modules/CheckCompilerFeatures.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ foreach(feature IN LISTS ALL_COMPILER_FEATURES)
5757
if(${feature} STREQUAL "float128")
5858
set(LIBC_COMPILER_HAS_FLOAT128 TRUE)
5959
elseif(${feature} STREQUAL "fixed_point")
60-
set(LIBC_COMPILER_HAS_FIXED_POINT TRUE)
60+
set(LIBC_COMPILER_HAS_FIXED_POINT TRUE)
6161
endif()
6262
endif()
6363
endforeach()

libc/cmake/modules/LLVMLibCCompileOptionRules.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function(_get_compile_options_from_flags output_var)
66
endif()
77
check_flag(ADD_SSE4_2_FLAG ${ROUND_OPT_FLAG} ${flags})
88
check_flag(ADD_EXPLICIT_SIMD_OPT_FLAG ${EXPLICIT_SIMD_OPT_FLAG} ${flags})
9-
9+
1010
if(LLVM_COMPILER_IS_GCC_COMPATIBLE)
1111
if(ADD_FMA_FLAG)
1212
if(LIBC_TARGET_ARCHITECTURE_IS_X86)

libc/cmake/modules/LLVMLibCLibraryRules.cmake

+4-4
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function(add_gpu_entrypoint_library target_name base_target_name)
125125
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/binary/${name}.gpubin"
126126
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/binary
127127
COMMAND ${LIBC_CLANG_OFFLOAD_PACKAGER}
128-
"${prefix},file=$<JOIN:${object},,file=>" -o
128+
"${prefix},file=$<JOIN:${object},,file=>" -o
129129
${CMAKE_CURRENT_BINARY_DIR}/binary/${name}.gpubin
130130
DEPENDS ${dep} ${base_target_name}
131131
COMMENT "Packaging LLVM offloading binary for '${object}'"
@@ -142,7 +142,7 @@ function(add_gpu_entrypoint_library target_name base_target_name)
142142
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/stubs/${name}.cpp
143143
DEPENDS ${dep} ${dep}.__gpubin__ ${base_target_name}
144144
)
145-
add_custom_target(${dep}.__stub__
145+
add_custom_target(${dep}.__stub__
146146
DEPENDS ${dep}.__gpubin__ "${CMAKE_CURRENT_BINARY_DIR}/stubs/${name}.cpp")
147147

148148
add_library(${dep}.__fatbin__
@@ -151,9 +151,9 @@ function(add_gpu_entrypoint_library target_name base_target_name)
151151
)
152152

153153
# This is always compiled for the LLVM host triple instead of the native GPU
154-
# triple that is used by default in the build.
154+
# triple that is used by default in the build.
155155
target_compile_options(${dep}.__fatbin__ BEFORE PRIVATE -nostdlib)
156-
target_compile_options(${dep}.__fatbin__ PRIVATE
156+
target_compile_options(${dep}.__fatbin__ PRIVATE
157157
--target=${LLVM_HOST_TRIPLE}
158158
"SHELL:-Xclang -fembed-offload-object=${CMAKE_CURRENT_BINARY_DIR}/binary/${name}.gpubin")
159159
add_dependencies(${dep}.__fatbin__

libc/cmake/modules/LLVMLibCObjectRules.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ function(create_entrypoint_object fq_target_name)
284284

285285
# The NVPTX target cannot use LTO for the internal targets used for testing.
286286
if(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
287-
target_compile_options(${internal_target_name} PRIVATE
287+
target_compile_options(${internal_target_name} PRIVATE
288288
-fno-lto -march=${LIBC_GPU_TARGET_ARCHITECTURE})
289289
endif()
290290

libc/cmake/modules/LLVMLibCTestRules.cmake

+7-7
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ function(add_libc_fuzzer target_name)
318318
target_include_directories(${fq_target_name} SYSTEM PRIVATE ${LIBC_INCLUDE_DIR})
319319
target_include_directories(${fq_target_name} PRIVATE ${LIBC_SOURCE_DIR})
320320

321-
target_link_libraries(${fq_target_name} PRIVATE
322-
${link_object_files}
321+
target_link_libraries(${fq_target_name} PRIVATE
322+
${link_object_files}
323323
${LIBC_FUZZER_LINK_LIBRARIES}
324324
)
325325

@@ -352,7 +352,7 @@ endif()
352352
# system libc are linked in to the final executable. The final exe is fully
353353
# statically linked. The libc that the final exe links to consists of only
354354
# the object files of the DEPENDS targets.
355-
#
355+
#
356356
# Usage:
357357
# add_integration_test(
358358
# <target name>
@@ -462,15 +462,15 @@ function(add_integration_test test_name)
462462
target_compile_options(${fq_build_target_name} PRIVATE ${compile_options})
463463

464464
if(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU)
465-
target_link_options(${fq_build_target_name} PRIVATE
465+
target_link_options(${fq_build_target_name} PRIVATE
466466
${LIBC_COMPILE_OPTIONS_DEFAULT}
467467
-mcpu=${LIBC_GPU_TARGET_ARCHITECTURE} -flto
468468
"-Wl,-mllvm,-amdgpu-lower-global-ctor-dtor=0" -nostdlib -static
469469
"-Wl,-mllvm,-amdhsa-code-object-version=${LIBC_GPU_CODE_OBJECT_VERSION}")
470470
elseif(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
471471
# We need to use the internal object versions for NVPTX.
472472
set(internal_suffix ".__internal__")
473-
target_link_options(${fq_build_target_name} PRIVATE
473+
target_link_options(${fq_build_target_name} PRIVATE
474474
${LIBC_COMPILE_OPTIONS_DEFAULT}
475475
"-Wl,--suppress-stack-size-warning"
476476
-march=${LIBC_GPU_TARGET_ARCHITECTURE} -nostdlib -static
@@ -645,15 +645,15 @@ function(add_libc_hermetic_test test_name)
645645
endforeach()
646646

647647
if(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU)
648-
target_link_options(${fq_build_target_name} PRIVATE
648+
target_link_options(${fq_build_target_name} PRIVATE
649649
${LIBC_COMPILE_OPTIONS_DEFAULT}
650650
-mcpu=${LIBC_GPU_TARGET_ARCHITECTURE} -flto
651651
"-Wl,-mllvm,-amdgpu-lower-global-ctor-dtor=0" -nostdlib -static
652652
"-Wl,-mllvm,-amdhsa-code-object-version=${LIBC_GPU_CODE_OBJECT_VERSION}")
653653
elseif(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
654654
# We need to use the internal object versions for NVPTX.
655655
set(internal_suffix ".__internal__")
656-
target_link_options(${fq_build_target_name} PRIVATE
656+
target_link_options(${fq_build_target_name} PRIVATE
657657
${LIBC_COMPILE_OPTIONS_DEFAULT}
658658
"-Wl,--suppress-stack-size-warning"
659659
-march=${LIBC_GPU_TARGET_ARCHITECTURE} -nostdlib -static

libc/config/darwin/x86_64/entrypoints.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ set(TARGET_LIBC_ENTRYPOINTS
1616
libc.src.ctype.toascii
1717
libc.src.ctype.tolower
1818
libc.src.ctype.toupper
19-
19+
2020
# string.h entrypoints
2121
libc.src.string.bcmp
2222
libc.src.string.bzero

libc/config/linux/x86_64/exclude.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ try_compile(
99
)
1010

1111
if(NOT has_sys_random)
12-
list(APPEND TARGET_LLVMLIBC_REMOVED_ENTRYPOINTS
12+
list(APPEND TARGET_LLVMLIBC_REMOVED_ENTRYPOINTS
1313
libc.src.sys.stat.stat
1414
)
1515
# If we're doing a fullbuild we provide the random header ourselves.
1616
if(NOT LLVM_LIBC_FULL_BUILD)
17-
list(APPEND TARGET_LLVMLIBC_REMOVED_ENTRYPOINTS
17+
list(APPEND TARGET_LLVMLIBC_REMOVED_ENTRYPOINTS
1818
libc.src.sys.random.getrandom
1919
)
2020
endif()

libc/config/windows/entrypoints.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ set(TARGET_LIBM_ENTRYPOINTS
116116
libc.src.math.acoshf
117117
libc.src.math.asinf
118118
libc.src.math.asinhf
119-
libc.src.math.atanf
119+
libc.src.math.atanf
120120
libc.src.math.atanhf
121121
libc.src.math.copysign
122122
libc.src.math.copysignf

libc/docs/contributing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ a list of open projects that one can start with:
2929
#. One is about adding CMake facilities to optionally link the libc's overlay
3030
static archive (see :ref:`overlay_mode`) with other LLVM tools/executables.
3131
#. The other is about putting plumbing in place to release the overlay static
32-
archive (see :ref:`overlay_mode`) as part of the LLVM binary releases.
32+
archive (see :ref:`overlay_mode`) as part of the LLVM binary releases.
3333

3434
#. **Implement Linux syscall wrappers** - A large portion of the POSIX API can
3535
be implemented as syscall wrappers on Linux. A good number have already been

libc/docs/date_and_time.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Implementation Status
2626

2727
* To check date and time functions enabled for Windows:
2828

29-
- `windows-x86_64 <https://github.com/llvm/llvm-project/tree/main/libc/config/windows/entrypoints.txt>`_
29+
- `windows-x86_64 <https://github.com/llvm/llvm-project/tree/main/libc/config/windows/entrypoints.txt>`_
3030

3131
- windows-aarch64 - to be added
3232

@@ -38,11 +38,11 @@ Implementation Status
3838

3939
* To check date and time functions enabled for GPU:
4040

41-
- `gpu-entrypoints <https://github.com/llvm/llvm-project/tree/main/libc/config/gpu/entrypoints.txt>`_
41+
- `gpu-entrypoints <https://github.com/llvm/llvm-project/tree/main/libc/config/gpu/entrypoints.txt>`_
4242

4343
* To check date and time functions enabled for embedded system:
4444

45-
- `barebone-aarch32 <https://github.com/llvm/llvm-project/tree/main/libc/config/baremetal/arm/entrypoints.txt>`_
45+
- `barebone-aarch32 <https://github.com/llvm/llvm-project/tree/main/libc/config/baremetal/arm/entrypoints.txt>`_
4646

4747
- barebone-riscv32 - to be added
4848

libc/docs/dev/clang_tidy_checks.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ a public header with non-namespaced functions like ``string.h`` is included.
7575
This check ensures any function call resolves to a function within the
7676
LIBC_NAMESPACE namespace.
7777

78-
There are exceptions for the following functions:
78+
There are exceptions for the following functions:
7979
``__errno_location`` so that ``errno`` can be set;
8080
``malloc``, ``calloc``, ``realloc``, ``aligned_alloc``, and ``free`` since they
8181
are always external and can be intercepted.

libc/docs/dev/config_options.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ example, the option-dictionary is:
6666
{
6767
"LIBC_CONF_PRINTF_DISABLE_FLOAT": {
6868
"value": false,
69-
"doc":
69+
"doc":
7070
},
7171
...
7272
}

libc/docs/dev/printf_behavior.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Printf Behavior Under All Conditions
33
====================================
44

5-
Introduction:
5+
Introduction:
66
=============
77
On the "defining undefined behavior" page, I said you should write down your
88
decisions regarding undefined behavior in your functions. This is that document
@@ -102,7 +102,7 @@ behavior.
102102
LIBC_COPT_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE
103103
-------------------------------------------------
104104
When set, the float to string decimal conversion algorithm will use a larger
105-
table to accelerate long double conversions. This larger table is around 5MB of
105+
table to accelerate long double conversions. This larger table is around 5MB of
106106
size when compiled.
107107

108108
LIBC_COPT_FLOAT_TO_STR_USE_DYADIC_FLOAT

libc/docs/full_cross_build.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ After configuring the build with the above ``cmake`` command, one can build the
8787
the libc for the target with the following command:
8888

8989
.. code-block:: sh
90-
90+
9191
$> ninja libc libm
9292
9393
The above ``ninja`` command will build the libc static archives ``libc.a`` and

libc/docs/gpu/motivation.rst

+15-15
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ Motivation and Limitations
1111
Motivation
1212
==========
1313

14-
This project aims to provide a large subset of the C standard library to users
15-
of GPU accelerators. We deliberately choose to only implement a subset of the C
16-
library as some features are not expressly useful or easily implemented on the
17-
GPU. This will be discussed further in `Limitations <libc_gpu_limitations>`_.
18-
The main motivation behind this project is to provide the well understood C
14+
This project aims to provide a large subset of the C standard library to users
15+
of GPU accelerators. We deliberately choose to only implement a subset of the C
16+
library as some features are not expressly useful or easily implemented on the
17+
GPU. This will be discussed further in `Limitations <libc_gpu_limitations>`_.
18+
The main motivation behind this project is to provide the well understood C
1919
library as a firm base for GPU development.
2020

21-
The main idea behind this project is that programming GPUs can be as
21+
The main idea behind this project is that programming GPUs can be as
2222
straightforward as programming on CPUs. This project aims to validate the GPU as
2323
a more general-purpose target. The implementations here will also enable more
2424
complex implementations of other libraries on the GPU, such as ``libc++``.
@@ -31,10 +31,10 @@ toolchain. We also aim to provide these functions in a format compatible with
3131
offloading in ``Clang`` so that we can treat the C library for the GPU as a
3232
standard static library.
3333

34-
A valuable use for providing C library features on the GPU is for testing. For
35-
this reason we build `tests on the GPU <libc_gpu_testing>`_ that can run a unit
36-
test as if it were being run on the CPU. This also helps users port applications
37-
that traditionally were run on the CPU. With this support, we can expand test
34+
A valuable use for providing C library features on the GPU is for testing. For
35+
this reason we build `tests on the GPU <libc_gpu_testing>`_ that can run a unit
36+
test as if it were being run on the CPU. This also helps users port applications
37+
that traditionally were run on the CPU. With this support, we can expand test
3838
coverage for the GPU backend to the existing LLVM C library tests.
3939

4040
.. _libc_gpu_limitations:
@@ -43,9 +43,9 @@ Limitations
4343
===========
4444

4545
We only implement a subset of the standard C library. The GPU does not
46-
currently support thread local variables in all cases, so variables like
47-
``errno`` are not provided. Furthermore, the GPU under the OpenCL execution
48-
model cannot safely provide a mutex interface. This means that features like
49-
file buffering are not implemented on the GPU. We can also not easily provide
50-
threading features on the GPU due to the execution model so these will be
46+
currently support thread local variables in all cases, so variables like
47+
``errno`` are not provided. Furthermore, the GPU under the OpenCL execution
48+
model cannot safely provide a mutex interface. This means that features like
49+
file buffering are not implemented on the GPU. We can also not easily provide
50+
threading features on the GPU due to the execution model so these will be
5151
ignored, as will features like ``locale`` or ``time``.

0 commit comments

Comments
 (0)