[PATCH] D139335: [BOLT] Fix blocks layout reverse iterators

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 05:39:53 PST 2022


thakis added a comment.

This doesn't build: http://45.33.8.238/macm1/50229/step_4.txt

  FAILED: obj/bolt/lib/Passes/Passes.MCF.o 
  /Users/thakis/src/depot_tools/.cipd_bin/gomacc ../../chromeclang/bin/clang++ -MMD -MF obj/bolt/lib/Passes/Passes.MCF.o.d -o obj/bolt/lib/Passes/Passes.MCF.o -c ../../bolt/lib/Passes/MCF.cpp  -I../../llvm/include -Igen/llvm/include -I../../bolt/include -Igen/bolt/include -mmacos-version-min=10.10 -O3 -fdiagnostics-color -Wall -Wextra -Wno-unused-parameter -Wdelete-non-virtual-dtor -Wstring-conversion -Wno-nonportable-include-path -no-canonical-prefixes -Werror=date-time -isysroot ../../sysroot/MacOSX.sdk -Wpoison-system-directories -fPIC -Wcovered-switch-default -std=c++17 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti
  warning: include location '/usr/local/include' is unsafe for cross-compilation [-Wpoison-system-directories]
  In file included from ../../bolt/lib/Passes/MCF.cpp:14:
  In file included from ../../bolt/include/bolt/Core/BinaryFunction.h:28:
  In file included from ../../bolt/include/bolt/Core/BinaryBasicBlock.h:18:
  ../../bolt/include/bolt/Core/FunctionLayout.h:309:12: error: no matching conversion for functional-style cast from 'llvm::SmallVectorTemplateCommon<llvm::bolt::BinaryBasicBlock *>::const_reverse_iterator' (aka 'reverse_iterator<llvm::bolt::BinaryBasicBlock *const *>') to 'llvm::bolt::FunctionLayout::block_const_reverse_iterator' (aka 'reverse_iterator<pointer_iterator<pointee_iterator<llvm::bolt::BinaryBasicBlock *const *, const llvm::bolt::BinaryBasicBlock>, const llvm::bolt::BinaryBasicBlock *>>')
      return block_const_reverse_iterator(Blocks.rbegin());
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../../chromeclang/bin/../include/c++/v1/__iterator/reverse_iterator.h:34:28: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'reverse_iterator<llvm::SmallVectorTemplateCommon<llvm::bolt::BinaryBasicBlock *>::const_iterator>' to 'const reverse_iterator<llvm::pointer_iterator<llvm::pointee_iterator<llvm::bolt::BinaryBasicBlock *const *, const llvm::bolt::BinaryBasicBlock>, const llvm::bolt::BinaryBasicBlock *>>' for 1st argument
  class _LIBCPP_TEMPLATE_VIS reverse_iterator
                             ^
  ../../chromeclang/bin/../include/c++/v1/__iterator/reverse_iterator.h:34:28: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'reverse_iterator<llvm::SmallVectorTemplateCommon<llvm::bolt::BinaryBasicBlock *>::const_iterator>' to 'reverse_iterator<llvm::pointer_iterator<llvm::pointee_iterator<llvm::bolt::BinaryBasicBlock *const *, const llvm::bolt::BinaryBasicBlock>, const llvm::bolt::BinaryBasicBlock *>>' for 1st argument
  ../../chromeclang/bin/../include/c++/v1/__iterator/reverse_iterator.h:76:14: note: candidate constructor not viable: no known conversion from 'llvm::SmallVectorTemplateCommon<llvm::bolt::BinaryBasicBlock *>::const_reverse_iterator' (aka 'reverse_iterator<llvm::bolt::BinaryBasicBlock *const *>') to 'llvm::pointer_iterator<llvm::pointee_iterator<llvm::bolt::BinaryBasicBlock *const *, const llvm::bolt::BinaryBasicBlock>, const llvm::bolt::BinaryBasicBlock *>' for 1st argument
      explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {}
               ^
  ../../chromeclang/bin/../include/c++/v1/__iterator/reverse_iterator.h:82:5: note: candidate template ignored: requirement 'is_convertible<llvm::bolt::BinaryBasicBlock *const *const &, llvm::pointer_iterator<llvm::pointee_iterator<llvm::bolt::BinaryBasicBlock *const *, const llvm::bolt::BinaryBasicBlock>, const llvm::bolt::BinaryBasicBlock *>>::value' was not satisfied [with _Up = llvm::bolt::BinaryBasicBlock *const *]
      reverse_iterator(const reverse_iterator<_Up>& __u)
      ^
  ../../chromeclang/bin/../include/c++/v1/__iterator/reverse_iterator.h:73:5: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
      reverse_iterator() : __t(), current() {}
      ^
  In file included from ../../bolt/lib/Passes/MCF.cpp:14:
  In file included from ../../bolt/include/bolt/Core/BinaryFunction.h:28:
  In file included from ../../bolt/include/bolt/Core/BinaryBasicBlock.h:18:
  ../../bolt/include/bolt/Core/FunctionLayout.h:315:12: error: no matching conversion for functional-style cast from 'llvm::SmallVectorTemplateCommon<llvm::bolt::BinaryBasicBlock *>::const_reverse_iterator' (aka 'reverse_iterator<llvm::bolt::BinaryBasicBlock *const *>') to 'llvm::bolt::FunctionLayout::block_const_reverse_iterator' (aka 'reverse_iterator<pointer_iterator<pointee_iterator<llvm::bolt::BinaryBasicBlock *const *, const llvm::bolt::BinaryBasicBlock>, const llvm::bolt::BinaryBasicBlock *>>')
      return block_const_reverse_iterator(Blocks.rend());
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../../chromeclang/bin/../include/c++/v1/__iterator/reverse_iterator.h:34:28: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'reverse_iterator<llvm::SmallVectorTemplateCommon<llvm::bolt::BinaryBasicBlock *>::const_iterator>' to 'const reverse_iterator<llvm::pointer_iterator<llvm::pointee_iterator<llvm::bolt::BinaryBasicBlock *const *, const llvm::bolt::BinaryBasicBlock>, const llvm::bolt::BinaryBasicBlock *>>' for 1st argument
  class _LIBCPP_TEMPLATE_VIS reverse_iterator
                             ^
  ../../chromeclang/bin/../include/c++/v1/__iterator/reverse_iterator.h:34:28: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'reverse_iterator<llvm::SmallVectorTemplateCommon<llvm::bolt::BinaryBasicBlock *>::const_iterator>' to 'reverse_iterator<llvm::pointer_iterator<llvm::pointee_iterator<llvm::bolt::BinaryBasicBlock *const *, const llvm::bolt::BinaryBasicBlock>, const llvm::bolt::BinaryBasicBlock *>>' for 1st argument
  ../../chromeclang/bin/../include/c++/v1/__iterator/reverse_iterator.h:76:14: note: candidate constructor not viable: no known conversion from 'llvm::SmallVectorTemplateCommon<llvm::bolt::BinaryBasicBlock *>::const_reverse_iterator' (aka 'reverse_iterator<llvm::bolt::BinaryBasicBlock *const *>') to 'llvm::pointer_iterator<llvm::pointee_iterator<llvm::bolt::BinaryBasicBlock *const *, const llvm::bolt::BinaryBasicBlock>, const llvm::bolt::BinaryBasicBlock *>' for 1st argument
      explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {}
               ^
  ../../chromeclang/bin/../include/c++/v1/__iterator/reverse_iterator.h:82:5: note: candidate template ignored: requirement 'is_convertible<llvm::bolt::BinaryBasicBlock *const *const &, llvm::pointer_iterator<llvm::pointee_iterator<llvm::bolt::BinaryBasicBlock *const *, const llvm::bolt::BinaryBasicBlock>, const llvm::bolt::BinaryBasicBlock *>>::value' was not satisfied [with _Up = llvm::bolt::BinaryBasicBlock *const *]
      reverse_iterator(const reverse_iterator<_Up>& __u)
      ^
  ../../chromeclang/bin/../include/c++/v1/__iterator/reverse_iterator.h:73:5: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
      reverse_iterator() : __t(), current() {}
      ^
  1 warning and 2 errors generated.

Reverting for now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139335/new/

https://reviews.llvm.org/D139335



More information about the llvm-commits mailing list