[llvm] Extend GCC workaround to GCC < 8.4 for llvm::iterator_range ctor (PR #82643)

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 19:33:25 PST 2024


loongknown wrote:

Have you tested on GCC 8.3.0? Even after applying this patch, I'm still getting compilation errors. The error message is as follows:

/home/dongshuai/test/llvm-project/mlir/lib/Transforms/Utils/CFGToSCF.cpp: In function ‘mlir::FailureOr<llvm::SmallVectormlir::Block* > transformToStructuredCFBranches(mlir::Block*, mlir::function_ref<mlir::Value(unsigned int)>, mlir::function_refmlir::Value(mlir::Type), mlir::CFGToSCFInterface&, mlir::DominanceInfo&)’:
/home/dongshuai/test/llvm-project/mlir/lib/Transforms/Utils/CFGToSCF.cpp:1187:61: error: call of overloaded ‘OperandRange(mlir::MutableOperandRange)’ is ambiguous
getMutableSuccessorOperands(user->getBlock(), 0)));
^
In file included from /home/dongshuai/test/llvm-project/mlir/include/mlir/Support/TypeID.h:20,
from /home/dongshuai/test/llvm-project/mlir/include/mlir/IR/MLIRContext.h:13,
from /home/dongshuai/test/llvm-project/mlir/include/mlir/IR/DialectRegistry.h:16,
from /home/dongshuai/test/llvm-project/mlir/include/mlir/IR/Dialect.h:16,
from /home/dongshuai/test/llvm-project/mlir/include/mlir/IR/OpDefinition.h:22,
from /home/dongshuai/test/llvm-project/mlir/include/mlir/IR/Builders.h:12,
from /home/dongshuai/test/llvm-project/mlir/include/mlir/Transforms/CFGToSCF.h:18,
from /home/dongshuai/test/llvm-project/mlir/lib/Transforms/Utils/CFGToSCF.cpp:116:
/home/dongshuai/test/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1273:3: note: candidate: ‘llvm::detail::indexed_accessor_range_base<DerivedT, BaseT, T, PointerT, ReferenceT>::indexed_accessor_range_base(const llvm::iterator_range<llvm::detail::indexed_accessor_range_base<DerivedT, BaseT, T, PointerT, ReferenceT>::iterator>&) [with DerivedT = mlir::OperandRange; BaseT = mlir::OpOperand*; T = mlir::Value; PointerT = mlir::Value; ReferenceT = mlir::Value]’
indexed_accessor_range_base(const iterator_range &range)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/dongshuai/test/llvm-project/mlir/include/mlir/IR/TypeRange.h:18,
from /home/dongshuai/test/llvm-project/mlir/include/mlir/IR/OperationSupport.h:23,
from /home/dongshuai/test/llvm-project/mlir/include/mlir/IR/Dialect.h:17,
from /home/dongshuai/test/llvm-project/mlir/include/mlir/IR/OpDefinition.h:22,
from /home/dongshuai/test/llvm-project/mlir/include/mlir/IR/Builders.h:12,
from /home/dongshuai/test/llvm-project/mlir/include/mlir/Transforms/CFGToSCF.h:18,
from /home/dongshuai/test/llvm-project/mlir/lib/Transforms/Utils/CFGToSCF.cpp:116:
/home/dongshuai/test/llvm-project/mlir/include/mlir/IR/ValueRange.h:44:21: note: inherited here
using RangeBaseT::RangeBaseT;
^~~~~~~~~~
/home/dongshuai/test/llvm-project/mlir/include/mlir/IR/ValueRange.h:41:7: note: candidate: ‘constexpr mlir::OperandRange::OperandRange(const mlir::OperandRange&)’
class OperandRange final : public llvm::detail::indexed_accessor_range_base<
^~~~~~~~~~~~
/home/dongshuai/test/llvm-project/mlir/include/mlir/IR/ValueRange.h:41:7: note: candidate: ‘constexpr mlir::OperandRange::OperandRange(mlir::OperandRange&&)’

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


More information about the llvm-commits mailing list