[llvm] [Target] Use llvm::append_range (NFC) (PR #133606)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 30 01:03:01 PDT 2025
arsenm wrote:
This is breaking the macOS build:
```
FAILED: lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86WinEHState.cpp.o
/usr/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/matt/src/llvm-project/build_rel_with_debinfo/lib/Target/X86 -I/Users/matt/src/llvm-project/llvm/lib/Target/X86 -I/Users/matt/src/llvm-project/build_rel_with_debinfo/include -I/Users/matt/src/llvm-project/llvm/include -isystem /opt/local/include -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 -O2 -g -DNDEBUG -std=c++17 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -gsplit-dwarf -MD -MT lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86WinEHState.cpp.o -MF lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86WinEHState.cpp.o.d -o lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86WinEHState.cpp.o -c /Users/matt/src/llvm-project/llvm/lib/Target/X86/X86WinEHState.cpp
In file included from /Users/matt/src/llvm-project/llvm/lib/Target/X86/X86WinEHState.cpp:17:
In file included from /Users/matt/src/llvm-project/llvm/include/llvm/ADT/PostOrderIterator.h:19:
In file included from /Users/matt/src/llvm-project/llvm/include/llvm/ADT/GraphTraits.h:22:
In file included from /Users/matt/src/llvm-project/llvm/include/llvm/ADT/STLExtras.h:21:
In file included from /Users/matt/src/llvm-project/llvm/include/llvm/ADT/Hashing.h:52:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/algorithm:1795:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/__algorithm/copy_backward.h:98:68: error: invalid operands to binary expression ('llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>' and 'long')
98 | auto __iter = std::__copy_backward<_AlgPolicy>(__last - __size, __last, __local_last).second;
| ~~~~~~ ^ ~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/__algorithm/copy_move_common.h:109:19: note: in instantiation of function template specialization 'std::__copy_backward_loop<std::_ClassicAlgPolicy>::operator()<llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>, std::__deque_iterator<llvm::BasicBlock *, llvm::BasicBlock **, llvm::BasicBlock *&, llvm::BasicBlock ***, long>, 0>' requested here
109 | auto __result = _Algorithm()(std::move(__range.first), std::move(__range.second), std::__unwrap_iter(__out_first));
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/__algorithm/copy_move_common.h:133:15: note: in instantiation of function template specialization 'std::__unwrap_and_dispatch<std::__overload<std::__copy_backward_loop<std::_ClassicAlgPolicy>, std::__copy_backward_trivial>, llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>, llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>, std::__deque_iterator<llvm::BasicBlock *, llvm::BasicBlock **, llvm::BasicBlock *&, llvm::BasicBlock ***, long>, 0>' requested here
133 | return std::__unwrap_and_dispatch<_Algorithm>(std::move(__first), std::move(__last), std::move(__out_first));
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/__algorithm/copy_backward.h:121:15: note: in instantiation of function template specialization 'std::__dispatch_copy_or_move<std::_ClassicAlgPolicy, std::__copy_backward_loop<std::_ClassicAlgPolicy>, std::__copy_backward_trivial, llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>, llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>, std::__deque_iterator<llvm::BasicBlock *, llvm::BasicBlock **, llvm::BasicBlock *&, llvm::BasicBlock ***, long>>' requested here
121 | return std::__dispatch_copy_or_move<_AlgPolicy, __copy_backward_loop<_AlgPolicy>, __copy_backward_trivial>(
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/__algorithm/copy_backward.h:132:15: note: in instantiation of function template specialization 'std::__copy_backward<std::_ClassicAlgPolicy, llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>, llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>, std::__deque_iterator<llvm::BasicBlock *, llvm::BasicBlock **, llvm::BasicBlock *&, llvm::BasicBlock ***, long>>' requested here
132 | return std::__copy_backward<_ClassicAlgPolicy>(std::move(__first), std::move(__last), std::move(__result)).second;
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/deque:1929:12: note: in instantiation of function template specialization 'std::copy_backward<llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>, std::__deque_iterator<llvm::BasicBlock *, llvm::BasicBlock **, llvm::BasicBlock *&, llvm::BasicBlock ***, long>>' requested here
1929 | std::copy_backward(__f, __m, __old_end);
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/deque:1865:10: note: in instantiation of function template specialization 'std::deque<llvm::BasicBlock *>::__insert_bidirectional<llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>>' requested here
1865 | return __insert_bidirectional(__p, __f, __l, std::distance(__f, __l));
| ^
/Users/matt/src/llvm-project/llvm/include/llvm/ADT/STLExtras.h:2121:5: note: in instantiation of function template specialization 'std::deque<llvm::BasicBlock *>::insert<llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>, 0>' requested here
2121 | C.insert(C.end(), adl_begin(R), adl_end(R));
| ^
/Users/matt/src/llvm-project/llvm/lib/Target/X86/X86WinEHState.cpp:724:11: note: in instantiation of function template specialization 'llvm::append_range<std::deque<llvm::BasicBlock *>, llvm::iterator_range<llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>>>' requested here
724 | llvm::append_range(Worklist, successors(BB));
| ^
/Users/matt/src/llvm-project/llvm/include/llvm/ADT/APInt.h:2193:14: note: candidate function not viable: no known conversion from 'llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>' to 'APInt' for 1st argument
2193 | inline APInt operator-(APInt a, uint64_t RHS) {
| ^ ~~~~~~~
/Users/matt/src/llvm-project/llvm/include/llvm/ADT/APInt.h:2182:14: note: candidate function not viable: no known conversion from 'llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>' to 'APInt' for 1st argument
2182 | inline APInt operator-(APInt a, const APInt &b) {
| ^ ~~~~~~~
/Users/matt/src/llvm-project/llvm/include/llvm/ADT/APInt.h:2187:14: note: candidate function not viable: no known conversion from 'llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>' to 'const APInt' for 1st argument
2187 | inline APInt operator-(const APInt &a, APInt &&b) {
| ^ ~~~~~~~~~~~~~~
/Users/matt/src/llvm-project/llvm/include/llvm/ADT/APInt.h:2198:14: note: candidate function not viable: no known conversion from 'llvm::SuccIterator<llvm::Instruction, llvm::BasicBlock>' to 'uint64_t' (aka 'unsigned long long') for 1st argument
2198 | inline APInt operator-(uint64_t LHS, APInt b) {
| ^ ~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/__iterator/move_iterator.h:304:1: note: candidate template ignored: could not match 'move_iterator' against 'SuccIterator'
304 | operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) -> decltype(__x.base() - __y.base()) {
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/__iterator/reverse_iterator.h:288:1: note: candidate template ignored: could not match 'reverse_iterator' against 'SuccIterator'
288 | operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include/c++/v1/__iterator/wrap_iter.h:182:5: note: candidate template ignored: could not match '__wrap_iter' against 'SuccIterator'
182 | operator-(const __wrap_iter<_Iter1>& __x,
| ^
/Users/matt/src/llvm-project/llvm/include/llvm/IR/CFG.h:213:7: note: candidate function not viable: no known conversion from 'long' to 'const Self' (aka 'const SuccIterator<llvm::Instruction, llvm::BasicBlock>') for 1st argument
213 | int operator-(const Self &RHS) const {
| ^ ~~~~~~~~~~~~~~~
/Users/matt/src/llvm-project/llvm/include/llvm/ADT/APInt.h:2157:14: note: candidate function not viable: requires single argument 'v', but 2 arguments were provided
2157 | inline APInt operator-(APInt v) {
| ^ ~~~~~~~
1 error generated.
[11/18] Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMBaseInstrInfo.cpp.o
ninja: build stopped: subcommand failed.
```
https://github.com/llvm/llvm-project/pull/133606
More information about the llvm-commits
mailing list