diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-04-10 14:30:43 +0000 | 
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-04-10 14:30:43 +0000 | 
| commit | c80a40661c679880cb687f0154b75815edd74c3b (patch) | |
| tree | fbba0ec4631e0022576a708daefd7b8f53305449 /clang | |
| parent | 269ec0f47067ed03f83680db116bc0231005fd52 (diff) | |
| download | bcm5719-llvm-c80a40661c679880cb687f0154b75815edd74c3b.tar.gz bcm5719-llvm-c80a40661c679880cb687f0154b75815edd74c3b.zip  | |
Return std::unique_ptr to avoid a release and recreate.
llvm-svn: 234598
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/Frontend/CompilerInstance.h | 2 | ||||
| -rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 8 | 
2 files changed, 5 insertions, 5 deletions
diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h index 94966e1a5ed..dbdf6597be1 100644 --- a/clang/include/clang/Frontend/CompilerInstance.h +++ b/clang/include/clang/Frontend/CompilerInstance.h @@ -669,7 +669,7 @@ public:    /// 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, diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 70b3bc43784..5bb7f15b129 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -575,9 +575,9 @@ CompilerInstance::createOutputFile(StringRef OutputPath,                                     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(); @@ -593,7 +593,7 @@ CompilerInstance::createOutputFile(StringRef OutputPath,    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, @@ -681,7 +681,7 @@ llvm::raw_fd_ostream *CompilerInstance::createOutputFile(    if (TempPathName)      *TempPathName = TempFile; -  return OS.release(); +  return OS;  }  // Initialization Utilities  | 

