Skip to content

Commit 6afec89

Browse files
committed
capi to print stack trace on diagnostic
1 parent 6d09f00 commit 6afec89

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

mlir/include/mlir-c/IR.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ MLIR_CAPI_EXPORTED bool mlirContextIsRegisteredOperation(MlirContext context,
162162
MLIR_CAPI_EXPORTED void mlirContextSetThreadPool(MlirContext context,
163163
MlirLlvmThreadPool threadPool);
164164

165+
/// Sets the context to attach the stack trace for the source code location at
166+
/// which a diagnostic is emitted.
167+
MLIR_CAPI_EXPORTED void
168+
mlirContextPrintStackTraceOnDiagnostic(MlirContext context, bool enable);
169+
165170
//===----------------------------------------------------------------------===//
166171
// Dialect API.
167172
//===----------------------------------------------------------------------===//

mlir/lib/CAPI/IR/IR.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ void mlirContextSetThreadPool(MlirContext context,
114114
unwrap(context)->setThreadPool(*unwrap(threadPool));
115115
}
116116

117+
void mlirContextPrintStackTraceOnDiagnostic(MlirContext context, bool enable) {
118+
unwrap(context)->printStackTraceOnDiagnostic(enable);
119+
}
120+
117121
//===----------------------------------------------------------------------===//
118122
// Dialect API.
119123
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)