This saves some copies of non-trivial objects.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/IR/Diagnostics.h | ||
---|---|---|
433–436 | This should also now indicate that diag may be consumed during emission, i.e. you can't rely on it being the same after this call. |
Internally here we were moving these, were the additional copies outside here/from user code invocation?
mlir/include/mlir/IR/Diagnostics.h | ||
---|---|---|
433–436 | Should we (and this would be more invasive ...) make this as rvalue to make it clear at call site that this is the case? Ref does indicate it can be modified but sounds like the expectation of the user should be more akin to what post move variable is. |
Use of r-value on user facing API LG.
A specific handler isn't guaranteed to completely handle a diagnostic, and can signal to the diagnostic engine that the diagnostic should be passed on to the next registered handler.
This should also now indicate that diag may be consumed during emission, i.e. you can't rely on it being the same after this call.