15 #include "llvm/ADT/Twine.h"
16 #include "llvm/Support/Debug.h"
19 auto &dbgStream = llvm::dbgs();
20 dbgStream <<
"===- " << str <<
" ";
21 width -= 6 + str.size();
23 dbgStream << std::string(
width - 3,
'-');
27 dbgStream << std::string(
width,
'=');
32 return debugHeader((llvm::Twine(
"Running ") + pass->getName()).str());
36 auto &dbgStream = llvm::dbgs();
38 int startWidth = std::min(
width - 3, 3);
39 dbgStream << std::string(startWidth,
'=');
43 dbgStream << std::string(
width - 3,
'-');
47 dbgStream << std::string(
width,
'=');
llvm::raw_ostream & debugHeader(llvm::StringRef str, int width=80)
Write a "header"-like string to the debug stream with a certain width.
llvm::raw_ostream & debugPassHeader(const mlir::Pass *pass, int width=80)
Write a boilerplate header for a pass to the debug stream.
llvm::raw_ostream & debugFooter(int width=80)
Write a boilerplate footer to the debug stream to indicate that a pass has ended.