aboutsummaryrefslogtreecommitdiff
path: root/mlir/include/mlir-c/Debug.h
diff options
context:
space:
mode:
authorNicolas Vasilache <nico.vasilache@amd.com>2025-07-04 10:52:53 +0200
committerNicolas Vasilache <nico.vasilache@amd.com>2025-07-04 11:59:57 +0200
commit3a632bd7deadf2150d2fb64e732cf9c52ce6c83e (patch)
tree318aaccff0978deedab523d46c462b161e78c836 /mlir/include/mlir-c/Debug.h
parent2b8f82b2bad6b2ada988fb2b874d676aa748a35b (diff)
downloadllvm-users/nico/python-2.zip
llvm-users/nico/python-2.tar.gz
llvm-users/nico/python-2.tar.bz2
[mlir][python] Add debug helpersusers/nico/python-2
This PR lets users provide --debug-only flags with python decorators. This greatly simplifies the debugging experience in python. Co-authored-by: Tres <tpopp@users.noreply.github.com>
Diffstat (limited to 'mlir/include/mlir-c/Debug.h')
-rw-r--r--mlir/include/mlir-c/Debug.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/mlir/include/mlir-c/Debug.h b/mlir/include/mlir-c/Debug.h
index 7dad735..8f206e4 100644
--- a/mlir/include/mlir-c/Debug.h
+++ b/mlir/include/mlir-c/Debug.h
@@ -31,6 +31,24 @@ MLIR_CAPI_EXPORTED void mlirSetGlobalDebugType(const char *type);
/// output to be produced.
MLIR_CAPI_EXPORTED void mlirSetGlobalDebugTypes(const char **types, intptr_t n);
+/// Adds to the current debug type state, similarly to
+/// `-debug-only=prev_type,new_type` in the command-line tools. Note that global
+/// debug should be enabled for any output to be produced. A single append call
+/// can be reverted with mlirPopAppendedGlobalDebugTypes.
+MLIR_CAPI_EXPORTED void mlirAppendGlobalDebugType(const char *type);
+
+/// Adds to the current debug type state, similarly to
+/// `-debug-only=prev_type,new_type1,new_type2` in the command-line tools. Note
+/// that global debug should be enabled for any output to be produced. A single
+/// append call can be reverted with mlirPopAppendedGlobalDebugTypes.
+MLIR_CAPI_EXPORTED void mlirAppendGlobalDebugTypes(const char **types,
+ intptr_t n);
+
+/// Restores the current debug type state to its state before the last append
+/// call. An appended state of `-debug-only=prev_type,new_type1,new_type2` would
+/// be `-debug-only=prev_type` after this call.
+MLIR_CAPI_EXPORTED void mlirPopAppendedGlobalDebugTypes();
+
/// Checks if `type` is set as the current debug type.
MLIR_CAPI_EXPORTED bool mlirIsCurrentDebugType(const char *type);