OSDN Git Service

Use unique names for each LLVM IR dump
authorChris Forbes <chrisforbes@google.com>
Fri, 28 Dec 2018 17:58:24 +0000 (09:58 -0800)
committerChris Forbes <chrisforbes@google.com>
Tue, 22 Jan 2019 18:55:57 +0000 (18:55 +0000)
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>
src/Reactor/LLVMReactor.cpp

index 8b4dcc0..344fe52 100644 (file)
@@ -911,7 +911,7 @@ namespace rr
 #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 @@ namespace rr
 #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);
                }