/// stored here on success.
/// \param TempPathName [out] - If given, the temporary file path name
/// will be stored here on success.
- static llvm::raw_fd_ostream *
+ static std::unique_ptr<llvm::raw_fd_ostream>
createOutputFile(StringRef OutputPath, std::error_code &Error, bool Binary,
bool RemoveFileOnSignal, StringRef BaseInput,
StringRef Extension, bool UseTemporary,
bool CreateMissingDirectories) {
std::string OutputPathName, TempPathName;
std::error_code EC;
- std::unique_ptr<llvm::raw_fd_ostream> OS(createOutputFile(
+ std::unique_ptr<llvm::raw_fd_ostream> OS = createOutputFile(
OutputPath, EC, Binary, RemoveFileOnSignal, InFile, Extension,
- UseTemporary, CreateMissingDirectories, &OutputPathName, &TempPathName));
+ UseTemporary, CreateMissingDirectories, &OutputPathName, &TempPathName);
if (!OS) {
getDiagnostics().Report(diag::err_fe_unable_to_open_output) << OutputPath
<< EC.message();
return Ret;
}
-llvm::raw_fd_ostream *CompilerInstance::createOutputFile(
+std::unique_ptr<llvm::raw_fd_ostream> CompilerInstance::createOutputFile(
StringRef OutputPath, std::error_code &Error, bool Binary,
bool RemoveFileOnSignal, StringRef InFile, StringRef Extension,
bool UseTemporary, bool CreateMissingDirectories,
if (TempPathName)
*TempPathName = TempFile;
- return OS.release();
+ return OS;
}
// Initialization Utilities