13#ifndef CIRCT_SUPPORT_DEBUG_H
14#define CIRCT_SUPPORT_DEBUG_H
16#include "mlir/Pass/Pass.h"
17#include "llvm/ADT/Twine.h"
18#include "llvm/Support/Debug.h"
29llvm::raw_ostream &
debugHeader(
const llvm::Twine &str,
unsigned width = 80);
38llvm::raw_ostream &
debugPassHeader(
const mlir::Pass *pass,
unsigned width = 80);
54 if (::llvm::DebugFlag &&
55 ::llvm::isCurrentDebugType(
pass->getArgument().data(), 1))
60 if (::llvm::DebugFlag &&
61 ::llvm::isCurrentDebugType(
pass->getArgument().data(), 1))
70#define CIRCT_DEBUG_SCOPED_PASS_LOGGER(PASS) \
71 ScopedDebugPassLogger _scopedDebugPassLogger(PASS)
73#define CIRCT_DEBUG_SCOPED_PASS_LOGGER(PASS) \
RAII helper for creating a pass header and footer automatically.
ScopedDebugPassLogger(const mlir::Pass *pass, unsigned width=80)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
llvm::raw_ostream & debugHeader(const llvm::Twine &str, unsigned width=80)
Write a "header"-like string to the debug stream with a certain width.
llvm::raw_ostream & debugPassHeader(const mlir::Pass *pass, unsigned width=80)
Write a boilerplate header for a pass to the debug stream.
llvm::raw_ostream & debugFooter(unsigned width=80)
Write a boilerplate footer to the debug stream to indicate that a pass has ended.