MLIR  20.0.0git
Debug.h
Go to the documentation of this file.
1 //===-- mlir-c/Debug.h - C API for MLIR/LLVM debugging functions --*- C -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM
4 // Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "mlir-c/Support.h"
11 
12 #include <stdbool.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 /// Sets the global debugging flag.
20 
21 /// Retuns `true` if the global debugging flag is set, false otherwise.
23 
24 /// Sets the current debug type, similarly to `-debug-only=type` in the
25 /// command-line tools. Note that global debug should be enabled for any output
26 /// to be produced.
27 MLIR_CAPI_EXPORTED void mlirSetGlobalDebugType(const char *type);
28 
29 /// Sets multiple current debug types, similarly to `-debug-only=type1,type2" in
30 /// the command-line tools. Note that global debug should be enabled for any
31 /// output to be produced.
32 MLIR_CAPI_EXPORTED void mlirSetGlobalDebugTypes(const char **types, intptr_t n);
33 
34 /// Checks if `type` is set as the current debug type.
35 MLIR_CAPI_EXPORTED bool mlirIsCurrentDebugType(const char *type);
36 
37 #ifdef __cplusplus
38 }
39 #endif
40 
41 #ifndef MLIR_C_DEBUG_H
42 #define MLIR_C_DEBUG_H
43 #endif // MLIR_C_DEBUG_H
MLIR_CAPI_EXPORTED void mlirSetGlobalDebugType(const char *type)
Sets the current debug type, similarly to -debug-only=type in the command-line tools.
Definition: Debug.cpp:20
MLIR_CAPI_EXPORTED bool mlirIsCurrentDebugType(const char *type)
Checks if type is set as the current debug type.
Definition: Debug.cpp:33
MLIR_CAPI_EXPORTED void mlirSetGlobalDebugTypes(const char **types, intptr_t n)
Sets multiple current debug types, similarly to `-debug-only=type1,type2" in the command-line tools.
Definition: Debug.cpp:28
MLIR_CAPI_EXPORTED bool mlirIsGlobalDebugEnabled()
Retuns true if the global debugging flag is set, false otherwise.
Definition: Debug.cpp:18
MLIR_CAPI_EXPORTED void mlirEnableGlobalDebug(bool enable)
Sets the global debugging flag.
Definition: Debug.cpp:16
#define MLIR_CAPI_EXPORTED
Definition: Support.h:46