Specify the filename upon writing.
Change-Id: I5aac9401ab03cc5fa3a6573ef9c9dbdda9163149
diff --git a/src/compiler_llvm/compilation_unit.cc b/src/compiler_llvm/compilation_unit.cc
index 66fdba0..4eb7fb5 100644
--- a/src/compiler_llvm/compilation_unit.cc
+++ b/src/compiler_llvm/compilation_unit.cc
@@ -137,11 +137,11 @@
}
-bool CompilationUnit::WriteBitcodeToFile() {
+bool CompilationUnit::WriteBitcodeToFile(const std::string& bitcode_filename) {
std::string errmsg;
llvm::OwningPtr<llvm::tool_output_file> out_file(
- new llvm::tool_output_file(bitcode_filename_.c_str(), errmsg,
+ new llvm::tool_output_file(bitcode_filename.c_str(), errmsg,
llvm::raw_fd_ostream::F_Binary));