Skip to content

[Support] Construct SmallVector with ArrayRef (NFC) #137586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Apr 28, 2025

@llvm/pr-subscribers-llvm-support

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/137586.diff

1 Files Affected:

  • (modified) llvm/lib/Support/Program.cpp (+1-4)
diff --git a/llvm/lib/Support/Program.cpp b/llvm/lib/Support/Program.cpp
index 181f68cfbb8c3..23de621c6cb73 100644
--- a/llvm/lib/Support/Program.cpp
+++ b/llvm/lib/Support/Program.cpp
@@ -74,10 +74,7 @@ ProcessInfo sys::ExecuteNoWait(StringRef Program, ArrayRef<StringRef> Args,
 
 bool sys::commandLineFitsWithinSystemLimits(StringRef Program,
                                             ArrayRef<const char *> Args) {
-  SmallVector<StringRef, 8> StringRefArgs;
-  StringRefArgs.reserve(Args.size());
-  for (const char *A : Args)
-    StringRefArgs.emplace_back(A);
+  SmallVector<StringRef, 8> StringRefArgs(Args);
   return commandLineFitsWithinSystemLimits(Program, StringRefArgs);
 }
 

@kazutakahirata kazutakahirata merged commit 9314500 into llvm:main Apr 29, 2025
13 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_SmallVector_ArrayRef_llvm_Support branch April 29, 2025 05:25
@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 29, 2025

LLVM Buildbot has detected a new failure on builder fuchsia-x86_64-linux running on fuchsia-debian-64-us-central1-a-1 while building llvm at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/14014

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/fuchsia-linux.py ...' (failure)
...
[267/2502] Copying CXX header __charconv/tables.h
[268/2502] Copying CXX header __algorithm/ranges_contains_subrange.h
[269/2502] Generating header locale.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/locale.yaml
[270/2502] Copying CXX header __algorithm/ranges_equal_range.h
[271/2502] Copying CXX header __charconv/chars_format.h
[272/2502] Copying CXX header __charconv/to_chars.h
[273/2502] Generating header ctype.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/ctype.yaml
[274/2502] Copying CXX header __bit/countr.h
[275/2502] Generating header fenv.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/fenv.yaml
[276/2502] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.bcopy.dir/bcopy.cpp.obj
FAILED: libc/src/strings/CMakeFiles/libc.src.strings.bcopy.dir/bcopy.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-m9geu8s0/./bin/clang++ --target=armv7em-none-eabi -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-m9geu8s0/include/armv7em-unknown-none-eabi --target=armv7em-none-eabi -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -mthumb -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-m9geu8s0/runtimes/runtimes-armv7em-none-eabi-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG --target=armv7em-none-eabi -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_TYPES_TIME_T_IS_32_BIT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/strings/CMakeFiles/libc.src.strings.bcopy.dir/bcopy.cpp.obj -MF libc/src/strings/CMakeFiles/libc.src.strings.bcopy.dir/bcopy.cpp.obj.d -o libc/src/strings/CMakeFiles/libc.src.strings.bcopy.dir/bcopy.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/strings/bcopy.cpp
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/strings/bcopy.cpp:12:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/string/memory_utils/inline_memmove.h:38:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/string/memory_utils/generic/byte_per_byte.h:17:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/string/memory_utils/utils.h:15:
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:43:13: error: unknown type name 'uint8_t'
   43 | LIBC_INLINE uint8_t
      |             ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:44:48: error: use of undeclared identifier 'uint8_t'
   44 | Endian<__ORDER_LITTLE_ENDIAN__>::to_big_endian<uint8_t>(uint8_t v) {
      |                                                ^~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:44:48: error: use of undeclared identifier 'uint8_t'
   44 | Endian<__ORDER_LITTLE_ENDIAN__>::to_big_endian<uint8_t>(uint8_t v) {
      |                                                ^~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:44:57: error: unknown type name 'uint8_t'
   44 | Endian<__ORDER_LITTLE_ENDIAN__>::to_big_endian<uint8_t>(uint8_t v) {
      |                                                         ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:49:13: error: unknown type name 'uint8_t'
   49 | LIBC_INLINE uint8_t
      |             ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:50:51: error: use of undeclared identifier 'uint8_t'
   50 | Endian<__ORDER_LITTLE_ENDIAN__>::to_little_endian<uint8_t>(uint8_t v) {
      |                                                   ^~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:50:51: error: use of undeclared identifier 'uint8_t'
   50 | Endian<__ORDER_LITTLE_ENDIAN__>::to_little_endian<uint8_t>(uint8_t v) {
      |                                                   ^~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:50:60: error: unknown type name 'uint8_t'
   50 | Endian<__ORDER_LITTLE_ENDIAN__>::to_little_endian<uint8_t>(uint8_t v) {
      |                                                            ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:55:13: error: unknown type name 'uint16_t'
   55 | LIBC_INLINE uint16_t
      |             ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:56:48: error: use of undeclared identifier 'uint16_t'
   56 | Endian<__ORDER_LITTLE_ENDIAN__>::to_big_endian<uint16_t>(uint16_t v) {
      |                                                ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:56:48: error: use of undeclared identifier 'uint16_t'
   56 | Endian<__ORDER_LITTLE_ENDIAN__>::to_big_endian<uint16_t>(uint16_t v) {
      |                                                ^~~~~~~~
Step 6 (build) failure: build (failure)
...
[267/2502] Copying CXX header __charconv/tables.h
[268/2502] Copying CXX header __algorithm/ranges_contains_subrange.h
[269/2502] Generating header locale.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/locale.yaml
[270/2502] Copying CXX header __algorithm/ranges_equal_range.h
[271/2502] Copying CXX header __charconv/chars_format.h
[272/2502] Copying CXX header __charconv/to_chars.h
[273/2502] Generating header ctype.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/ctype.yaml
[274/2502] Copying CXX header __bit/countr.h
[275/2502] Generating header fenv.h from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/runtimes/../libc/include/fenv.yaml
[276/2502] Building CXX object libc/src/strings/CMakeFiles/libc.src.strings.bcopy.dir/bcopy.cpp.obj
FAILED: libc/src/strings/CMakeFiles/libc.src.strings.bcopy.dir/bcopy.cpp.obj 
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-m9geu8s0/./bin/clang++ --target=armv7em-none-eabi -DLIBC_NAMESPACE=__llvm_libc_21_0_0_git -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc -isystem /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-m9geu8s0/include/armv7em-unknown-none-eabi --target=armv7em-none-eabi -Wno-atomic-alignment "-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)" "-Dfprintf(stream, format, ...)=printf(format)" -D_LIBCPP_PRINT=1 -mthumb -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-m9geu8s0/runtimes/runtimes-armv7em-none-eabi-bins=../../../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -Os -DNDEBUG --target=armv7em-none-eabi -DLIBC_QSORT_IMPL=LIBC_QSORT_HEAP_SORT -DLIBC_TYPES_TIME_T_IS_32_BIT -DLIBC_ADD_NULL_CHECKS "-DLIBC_MATH=(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES)" -fpie -ffreestanding -DLIBC_FULL_BUILD -nostdlibinc -ffixed-point -fno-builtin -fno-exceptions -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -Wall -Wextra -Werror -Wconversion -Wno-sign-conversion -Wdeprecated -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors -DLIBC_COPT_PUBLIC_PACKAGING -MD -MT libc/src/strings/CMakeFiles/libc.src.strings.bcopy.dir/bcopy.cpp.obj -MF libc/src/strings/CMakeFiles/libc.src.strings.bcopy.dir/bcopy.cpp.obj.d -o libc/src/strings/CMakeFiles/libc.src.strings.bcopy.dir/bcopy.cpp.obj -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/strings/bcopy.cpp
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/strings/bcopy.cpp:12:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/string/memory_utils/inline_memmove.h:38:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/string/memory_utils/generic/byte_per_byte.h:17:
In file included from /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/string/memory_utils/utils.h:15:
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:43:13: error: unknown type name 'uint8_t'
   43 | LIBC_INLINE uint8_t
      |             ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:44:48: error: use of undeclared identifier 'uint8_t'
   44 | Endian<__ORDER_LITTLE_ENDIAN__>::to_big_endian<uint8_t>(uint8_t v) {
      |                                                ^~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:44:48: error: use of undeclared identifier 'uint8_t'
   44 | Endian<__ORDER_LITTLE_ENDIAN__>::to_big_endian<uint8_t>(uint8_t v) {
      |                                                ^~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:44:57: error: unknown type name 'uint8_t'
   44 | Endian<__ORDER_LITTLE_ENDIAN__>::to_big_endian<uint8_t>(uint8_t v) {
      |                                                         ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:49:13: error: unknown type name 'uint8_t'
   49 | LIBC_INLINE uint8_t
      |             ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:50:51: error: use of undeclared identifier 'uint8_t'
   50 | Endian<__ORDER_LITTLE_ENDIAN__>::to_little_endian<uint8_t>(uint8_t v) {
      |                                                   ^~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:50:51: error: use of undeclared identifier 'uint8_t'
   50 | Endian<__ORDER_LITTLE_ENDIAN__>::to_little_endian<uint8_t>(uint8_t v) {
      |                                                   ^~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:50:60: error: unknown type name 'uint8_t'
   50 | Endian<__ORDER_LITTLE_ENDIAN__>::to_little_endian<uint8_t>(uint8_t v) {
      |                                                            ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:55:13: error: unknown type name 'uint16_t'
   55 | LIBC_INLINE uint16_t
      |             ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:56:48: error: use of undeclared identifier 'uint16_t'
   56 | Endian<__ORDER_LITTLE_ENDIAN__>::to_big_endian<uint16_t>(uint16_t v) {
      |                                                ^~~~~~~~
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/libc/src/__support/endian_internal.h:56:48: error: use of undeclared identifier 'uint16_t'
   56 | Endian<__ORDER_LITTLE_ENDIAN__>::to_big_endian<uint16_t>(uint16_t v) {
      |                                                ^~~~~~~~

gizmondo pushed a commit to gizmondo/llvm-project that referenced this pull request Apr 29, 2025
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
GeorgeARM pushed a commit to GeorgeARM/llvm-project that referenced this pull request May 7, 2025
Ankur-0429 pushed a commit to Ankur-0429/llvm-project that referenced this pull request May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants