A const-qualified reference to function layout allows accessing
non-const qualified basic blocks on a const-qualified function. This
patch adds or removes const-qualifiers where necessary to indicate where
basic blocks are used in a non-const manner.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
We are seeing clang build warnings and errors after this patch was landed. Error message:
In file included from /b/s/w/ir/x/w/llvm-llvm-project/bolt/include/bolt/Core/BinaryBasicBlock.h:18: /b/s/w/ir/x/w/llvm-llvm-project/bolt/include/bolt/Core/FunctionLayout.h:307:62: error: no viable conversion from returned value of type 'reverse_iterator<const_iterator>' to function return type 'reverse_iterator<block_const_iterator>' block_const_reverse_iterator block_rbegin() const { return Blocks.rbegin(); } ^~~~~~~~~~~~~~~ /b/s/w/ir/x/w/cipd/bin/../include/c++/v1/__iterator/reverse_iterator.h:43:28: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const_reverse_iterator' (aka 'reverse_iterator<llvm::bolt::BinaryBasicBlock *const *>') to 'const std::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 ^ /b/s/w/ir/x/w/cipd/bin/../include/c++/v1/__iterator/reverse_iterator.h:43:28: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const_reverse_iterator' (aka 'reverse_iterator<llvm::bolt::BinaryBasicBlock *const *>') to 'std::reverse_iterator<llvm::pointer_iterator<llvm::pointee_iterator<llvm::bolt::BinaryBasicBlock *const *, const llvm::bolt::BinaryBasicBlock>, const llvm::bolt::BinaryBasicBlock *>> &&' for 1st argument /b/s/w/ir/x/w/cipd/bin/../include/c++/v1/__iterator/reverse_iterator.h:119: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) ^ /b/s/w/ir/x/w/cipd/bin/../include/c++/v1/__iterator/reverse_iterator.h:113:14: note: explicit constructor is not a candidate explicit reverse_iterator(_Iter __x) : current(__x) {}
Could you take a look? If it takes a while to fix. Could you revert your change please?
Full build task: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8804929257456173105/overview
Full build step output: https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8804929257456173105/+/u/clang/build/stdout