summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/SourceMgrTest.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-08-21 20:44:56 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-08-21 20:44:56 +0000
commit1961f14cf965e63d944d8888a089067cde142d10 (patch)
tree22b9817765f165fa1d6f170c4c029b48e7c8c718 /llvm/unittests/Support/SourceMgrTest.cpp
parente423ed36f064e0830040c623f2f0a66df1c20814 (diff)
downloadbcm5719-llvm-1961f14cf965e63d944d8888a089067cde142d10.tar.gz
bcm5719-llvm-1961f14cf965e63d944d8888a089067cde142d10.zip
Explicitly pass ownership of the MemoryBuffer to AddNewSourceBuffer using std::unique_ptr
llvm-svn: 216223
Diffstat (limited to 'llvm/unittests/Support/SourceMgrTest.cpp')
-rw-r--r--llvm/unittests/Support/SourceMgrTest.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/unittests/Support/SourceMgrTest.cpp b/llvm/unittests/Support/SourceMgrTest.cpp
index 2b69fe98444..26310c11ddb 100644
--- a/llvm/unittests/Support/SourceMgrTest.cpp
+++ b/llvm/unittests/Support/SourceMgrTest.cpp
@@ -23,8 +23,9 @@ public:
std::string Output;
void setMainBuffer(StringRef Text, StringRef BufferName) {
- MemoryBuffer *MainBuffer = MemoryBuffer::getMemBuffer(Text, BufferName);
- MainBufferID = SM.AddNewSourceBuffer(MainBuffer, llvm::SMLoc());
+ std::unique_ptr<MemoryBuffer> MainBuffer(
+ MemoryBuffer::getMemBuffer(Text, BufferName));
+ MainBufferID = SM.AddNewSourceBuffer(std::move(MainBuffer), llvm::SMLoc());
}
SMLoc getLoc(unsigned Offset) {
OpenPOWER on IntegriCloud