summaryrefslogtreecommitdiff
path: root/lib/Support/DataStream.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-06-21 13:59:01 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-06-21 13:59:01 +0000
commit3a0822f094b578157263e04114075ad7df81db41 (patch)
treebc48361fe2cd1ca5f93ac01b38b183774468fc79 /lib/Support/DataStream.cpp
parent85d8b2bbe386bcfe669575d05b61482d7be07e5d (diff)
Diffstat (limited to 'lib/Support/DataStream.cpp')
-rw-r--r--lib/Support/DataStream.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/Support/DataStream.cpp b/lib/Support/DataStream.cpp
index c24315526cff..ad05494f9c67 100644
--- a/lib/Support/DataStream.cpp
+++ b/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);
}