[llvm] [CFIFixup] Factor logic into helpers and use range-based loops (NFC) (PR #125137)

LLVM Continuous Integration via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 12:33:35 PST 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-expensive-checks-debian` running on `gribozavr4` while building `llvm` at step 5 "build-unified-tree".

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

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 5 (build-unified-tree) failure: build (failure)
...
16.850 [1027/46/3013] Linking CXX executable bin/llvm-stress
16.850 [1027/45/3014] Linking CXX static library lib/libLLVMSparcDesc.a
16.850 [1027/44/3015] Linking CXX static library lib/libLLVMSystemZDesc.a
16.851 [1026/44/3016] Linking CXX static library lib/libLLVMSPIRVDesc.a
16.852 [1026/43/3017] Linking CXX static library lib/libLLVMVEDesc.a
16.852 [1026/42/3018] Linking CXX static library lib/libLLVMVEDisassembler.a
16.852 [1026/41/3019] Linking CXX static library lib/libLLVMWebAssemblyDesc.a
16.859 [1025/41/3020] Linking CXX static library lib/libLLVMXCoreDisassembler.a
16.859 [1025/40/3021] Linking CXX static library lib/libLLVMXCoreDesc.a
16.860 [1025/39/3022] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CFIFixup.cpp.o
FAILED: lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CFIFixup.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/clang++ -DEXPENSIVE_CHECKS -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/1/llvm-clang-x86_64-expensive-checks-debian/build/lib/CodeGen -I/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/lib/CodeGen -I/b/1/llvm-clang-x86_64-expensive-checks-debian/build/include -I/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/include -U_GLIBCXX_DEBUG -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CFIFixup.cpp.o -MF lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CFIFixup.cpp.o.d -o lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CFIFixup.cpp.o -c /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/lib/CodeGen/CFIFixup.cpp
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/lib/CodeGen/CFIFixup.cpp:174:10: warning: local variable 'BlockInfo' will be copied despite being returned by name [-Wreturn-std-move]
  return BlockInfo;
         ^~~~~~~~~
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/lib/CodeGen/CFIFixup.cpp:174:10: note: call 'std::move' explicitly to avoid copying
  return BlockInfo;
         ^~~~~~~~~
         std::move(BlockInfo)
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/lib/CodeGen/CFIFixup.cpp:174:10: error: no viable conversion from returned value of type 'SmallVector<[...], 32>' to function return type 'SmallVector<[...], (default) CalculateSmallVectorDefaultInlinedElements<T>::value aka 40>'
  return BlockInfo;
         ^~~~~~~~~
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/include/llvm/ADT/SmallVector.h:1226:3: note: candidate constructor not viable: no known conversion from 'SmallVector<BlockFlags, 32>' to 'std::initializer_list<BlockFlags>' for 1st argument
  SmallVector(std::initializer_list<T> IL) : SmallVectorImpl<T>(N) {
  ^
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/include/llvm/ADT/SmallVector.h:1236:3: note: candidate constructor not viable: no known conversion from 'SmallVector<BlockFlags, 32>' to 'const llvm::SmallVector<BlockFlags, 40> &' for 1st argument
  SmallVector(const SmallVector &RHS) : SmallVectorImpl<T>(N) {
  ^
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/include/llvm/ADT/SmallVector.h:1246:3: note: candidate constructor not viable: no known conversion from 'SmallVector<BlockFlags, 32>' to 'llvm::SmallVector<BlockFlags, 40> &&' for 1st argument
  SmallVector(SmallVector &&RHS) : SmallVectorImpl<T>(N) {
  ^
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/include/llvm/ADT/SmallVector.h:1251:3: note: candidate constructor not viable: no known conversion from 'SmallVector<BlockFlags, 32>' to 'SmallVectorImpl<BlockFlags> &&' for 1st argument
  SmallVector(SmallVectorImpl<T> &&RHS) : SmallVectorImpl<T>(N) {
  ^
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/include/llvm/ADT/SmallVector.h:1205:12: note: explicit constructor is not a candidate
  explicit SmallVector(size_t Size)
           ^
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/include/llvm/ADT/SmallVector.h:1221:12: note: explicit constructor is not a candidate
  explicit SmallVector(const iterator_range<RangeTy> &R)
           ^
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/include/llvm/ADT/SmallVector.h:1232:12: note: explicit constructor is not a candidate
  explicit SmallVector(ArrayRef<U> A) : SmallVectorImpl<T>(N) {
           ^
1 warning and 1 error generated.
16.860 [1025/38/3023] Linking CXX static library lib/libLLVMIRReader.a
16.861 [1025/37/3024] Linking CXX static library lib/libLLVMLoongArchDisassembler.a
16.861 [1025/36/3025] Linking CXX static library lib/libLLVMLanaiDisassembler.a
16.873 [1025/35/3026] Linking CXX static library lib/libLLVMHexagonDisassembler.a
16.881 [1025/34/3027] Linking CXX static library lib/libLLVMWebAssemblyDisassembler.a

```

</details>

https://github.com/llvm/llvm-project/pull/125137


More information about the llvm-commits mailing list