[Mlir-commits] [mlir] [mlir] Add emitRemark overload taking ArrayRef<Twine> (PR #217804)
lonely eagle
llvmlistbot at llvm.org
Sat Aug 29 01:05:11 PDT 2026
================
----------------
linuxlonelyeagle wrote:
if we use` SmallVector<InFlightDiagnostic>`,it will report
```
/root/affine-mlir/llvm/llvm/include/llvm/ADT/SmallVector.h:1110:25: required from 'llvm::SmallVectorImpl<T>& llvm::SmallVectorImpl<T>::operator=(llvm::SmallVectorImpl<T>&&) [with T = mlir::InFlightDiagnostic]'
/root/affine-mlir/llvm/llvm/include/llvm/ADT/SmallVector.h:1286:36: required from 'llvm::SmallVector<T, N>::SmallVector(llvm::SmallVector<T, N>&&) [with T = mlir::InFlightDiagnostic; unsigned int N = 1]'
/root/affine-mlir/llvm/mlir/lib/IR/Operation.cpp:303:10: required from here
/usr/include/c++/13/bits/stl_algobase.h:413:25: error: use of deleted function 'mlir::InFlightDiagnostic& mlir::InFlightDiagnostic::operator=(mlir::InFlightDiagnostic&&)'
413 | *__result = std::move(*__first);
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /root/affine-mlir/llvm/mlir/include/mlir/IR/Operation.h:18:
/root/affine-mlir/llvm/mlir/include/mlir/IR/Diagnostics.h:398:23: note: declared here
398 | InFlightDiagnostic &operator=(InFlightDiagnostic &&) = delete;
```
So I use `std::vector`. In addition to this, we must use `std::move(diag)`, if we use `diags.push_back(diag);`. It will report
```
/usr/include/c++/13/bits/new_allocator.h: In instantiation of 'void std::__new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = mlir::InFlightDiagnostic; _Args = {const mlir::InFlightDiagnostic&}; _Tp = mlir::InFlightDiagnostic]':
/usr/include/c++/13/bits/alloc_traits.h:538:17: required from 'static void std::allocator_traits<std::allocator<_Tp1> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = mlir::InFlightDiagnostic; _Args = {const mlir::InFlightDiagnostic&}; _Tp = mlir::InFlightDiagnostic; allocator_type = std::allocator<mlir::InFlightDiagnostic>]'
/usr/include/c++/13/bits/stl_vector.h:1286:30: required from 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = mlir::InFlightDiagnostic; _Alloc = std::allocator<mlir::InFlightDiagnostic>; value_type = mlir::InFlightDiagnostic]'
/root/affine-mlir/llvm/mlir/lib/IR/Operation.cpp:301:20: required from here
/usr/include/c++/13/bits/new_allocator.h:191:11: error: use of deleted function 'mlir::InFlightDiagnostic::InFlightDiagnostic(const mlir::InFlightDiagnostic&)'
191 | { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/affine-mlir/llvm/mlir/include/mlir/IR/Operation.h:18:
/root/affine-mlir/llvm/mlir/include/mlir/IR/Diagnostics.h:327:7: note: 'mlir::InFlightDiagnostic::InFlightDiagnostic(const mlir::InFlightDiagnostic&)' is implicitly declared as deleted because 'mlir::InFlightDiagnostic' declares a move constructor or move assignment operator
327 | class InFlightDiagnostic {
```
https://github.com/llvm/llvm-project/pull/217804
More information about the Mlir-commits
mailing list