[Mlir-commits] [mlir] 60b6c93 - [mlir] Allow access to the underlying diagnostic
River Riddle
llvmlistbot at llvm.org
Fri Dec 2 00:48:57 PST 2022
Author: River Riddle
Date: 2022-12-02T00:48:34-08:00
New Revision: 60b6c93ee942496eb416018595c6308b5ae395e9
URL: https://github.com/llvm/llvm-project/commit/60b6c93ee942496eb416018595c6308b5ae395e9
DIFF: https://github.com/llvm/llvm-project/commit/60b6c93ee942496eb416018595c6308b5ae395e9.diff
LOG: [mlir] Allow access to the underlying diagnostic
This allows for more interesting manipulation of an
inflight diagnostic.
Added:
Modified:
mlir/include/mlir/IR/Diagnostics.h
Removed:
################################################################################
diff --git a/mlir/include/mlir/IR/Diagnostics.h b/mlir/include/mlir/IR/Diagnostics.h
index 9748072dafff8..58abb0c94ca2f 100644
--- a/mlir/include/mlir/IR/Diagnostics.h
+++ b/mlir/include/mlir/IR/Diagnostics.h
@@ -347,6 +347,10 @@ class InFlightDiagnostic {
return impl->attachNote(noteLoc);
}
+ /// Returns the underlying diagnostic or nullptr if this diagnostic isn't
+ /// active.
+ Diagnostic *getUnderlyingDiagnostic() { return impl ? &*impl : nullptr; }
+
/// Reports the diagnostic to the engine.
void report();
More information about the Mlir-commits
mailing list