1717
1818#include " llvm/ADT/STLExtras.h"
1919#include " llvm/ADT/StringSwitch.h"
20- #include " llvm/Support/Debug .h"
20+ #include " llvm/Support/DebugLog .h"
2121#include " llvm/Support/FileSystem.h"
2222#include " llvm/Support/Path.h"
2323#include " llvm/Support/ToolOutputFile.h"
@@ -43,14 +43,14 @@ static void dumpToFile(StringRef dumpDir, const llvm::Twine &filename,
4343 std::error_code ec;
4444 llvm::ToolOutputFile output (path, ec, llvm::sys::fs::OF_None);
4545 if (ec) {
46- LLVM_DEBUG ( llvm::dbgs ( ) << " Failed to create file '" << path
47- << " ': " << ec. message () << " \n " ) ;
46+ LDBG ( ) << " Failed to create file '" << path << " ': " << ec. message ()
47+ << " \n " ;
4848 return ;
4949 }
5050
5151 writeContent (output.os ());
5252 output.keep ();
53- LLVM_DEBUG ( llvm::dbgs ( ) << " Dumped intermediate to: " << path << " \n " ) ;
53+ LDBG ( ) << " Dumped intermediate to: " << path << " \n " ;
5454}
5555
5656namespace {
@@ -92,7 +92,7 @@ void GpuModuleToBinaryPass::runOnOperation() {
9292 for (const std::string &path : linkFiles)
9393 librariesToLink.push_back (StringAttr::get (&getContext (), path));
9494
95- // Create dump directory if specified
95+ // Create dump directory if specified.
9696 if (!dumpIntermediates.empty ()) {
9797 if (std::error_code ec =
9898 llvm::sys::fs::create_directories (dumpIntermediates)) {
@@ -102,20 +102,20 @@ void GpuModuleToBinaryPass::runOnOperation() {
102102 }
103103 }
104104
105- // Create callbacks for dumping intermediate artifacts if requested
106- auto initialIRCallback = [&](llvm::Module &module ) {
107- dumpToFile (dumpIntermediates, module .getName () + " .initial.ll" ,
108- [&](llvm::raw_ostream &os) { module .print (os, nullptr ); });
105+ // Create callbacks for dumping intermediate artifacts if requested.
106+ auto initialIRCallback = [&](llvm::Module &mod ) {
107+ dumpToFile (dumpIntermediates, mod .getName () + " .initial.ll" ,
108+ [&](llvm::raw_ostream &os) { mod .print (os, nullptr ); });
109109 };
110110
111- auto linkedIRCallback = [&](llvm::Module &module ) {
112- dumpToFile (dumpIntermediates, module .getName () + " .linked.ll" ,
113- [&](llvm::raw_ostream &os) { module .print (os, nullptr ); });
111+ auto linkedIRCallback = [&](llvm::Module &mod ) {
112+ dumpToFile (dumpIntermediates, mod .getName () + " .linked.ll" ,
113+ [&](llvm::raw_ostream &os) { mod .print (os, nullptr ); });
114114 };
115115
116- auto optimizedIRCallback = [&](llvm::Module &module ) {
117- dumpToFile (dumpIntermediates, module .getName () + " .opt.ll" ,
118- [&](llvm::raw_ostream &os) { module .print (os, nullptr ); });
116+ auto optimizedIRCallback = [&](llvm::Module &mod ) {
117+ dumpToFile (dumpIntermediates, mod .getName () + " .opt.ll" ,
118+ [&](llvm::raw_ostream &os) { mod .print (os, nullptr ); });
119119 };
120120
121121 auto isaCallback = [&](StringRef isa) {
0 commit comments