Use unique names for each LLVM IR dump
Previously this would just repeatedly overwrite the one file, which
makes it difficult to see what's happening when you compile a pipeline
that needs 3 routines.
Change-Id: Ibab115f5ccbb17333d504e4e7948be54ca304f9d
Bug: b/123193054
Reviewed-on: https://swiftshader-review.googlesource.com/c/23469
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp
index 8b4dcc0..344fe52 100644
--- a/src/Reactor/LLVMReactor.cpp
+++ b/src/Reactor/LLVMReactor.cpp
@@ -911,7 +911,7 @@
#else
std::error_code error;
#endif
- llvm::raw_fd_ostream file("llvm-dump-unopt.txt", error);
+ llvm::raw_fd_ostream file(std::string(name) + "-llvm-dump-unopt.txt", error);
::module->print(file, 0);
}
@@ -927,7 +927,7 @@
#else
std::error_code error;
#endif
- llvm::raw_fd_ostream file("llvm-dump-opt.txt", error);
+ llvm::raw_fd_ostream file(std::string(name) + "-llvm-dump-opt.txt", error);
::module->print(file, 0);
}