diff options
Diffstat (limited to 'contrib/llvm/lib/Support/DataStream.cpp')
-rw-r--r-- | contrib/llvm/lib/Support/DataStream.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/contrib/llvm/lib/Support/DataStream.cpp b/contrib/llvm/lib/Support/DataStream.cpp index c243155..ad05494 100644 --- a/contrib/llvm/lib/Support/DataStream.cpp +++ b/contrib/llvm/lib/Support/DataStream.cpp @@ -16,6 +16,7 @@ #include "llvm/Support/DataStream.h" #include "llvm/ADT/Statistic.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Program.h" #include <string> @@ -71,18 +72,15 @@ public: } }; -} +} // namespace -namespace llvm { -DataStreamer *getDataFileStreamer(const std::string &Filename, - std::string *StrError) { - DataFileStreamer *s = new DataFileStreamer(); +std::unique_ptr<DataStreamer> +llvm::getDataFileStreamer(const std::string &Filename, std::string *StrError) { + std::unique_ptr<DataFileStreamer> s = make_unique<DataFileStreamer>(); if (std::error_code e = s->OpenFile(Filename)) { *StrError = std::string("Could not open ") + Filename + ": " + e.message() + "\n"; return nullptr; } - return s; -} - + return std::move(s); } |