diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-08-27 20:54:45 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-08-27 20:54:45 +0000 |
commit | 926a507ee587f1455010dca59ffd0253d2bf70ff (patch) | |
tree | 044480b7bdd37e1a016e0727f44de218d9bba5f9 /unittests/Basic/SourceManagerTest.cpp | |
parent | c8df8573681a027384d7bec55866f51ae74f8393 (diff) | |
download | clang-926a507ee587f1455010dca59ffd0253d2bf70ff.tar.gz |
Overload SourceManager::overrideFileContents so that unconditionally passing ownership is explicitly done using unique_ptr.
Only those callers who are dynamically passing ownership should need the
3 argument form. Those accepting the default ("do pass ownership")
should do so explicitly with a unique_ptr now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216614 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Basic/SourceManagerTest.cpp')
-rw-r--r-- | unittests/Basic/SourceManagerTest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/unittests/Basic/SourceManagerTest.cpp b/unittests/Basic/SourceManagerTest.cpp index dc27560b3a..540a8051e6 100644 --- a/unittests/Basic/SourceManagerTest.cpp +++ b/unittests/Basic/SourceManagerTest.cpp @@ -193,7 +193,7 @@ TEST_F(SourceManagerTest, getMacroArgExpandedLocation) { const FileEntry *headerFile = FileMgr.getVirtualFile("/test-header.h", HeaderBuf->getBufferSize(), 0); - SourceMgr.overrideFileContents(headerFile, HeaderBuf.release()); + SourceMgr.overrideFileContents(headerFile, std::move(HeaderBuf)); VoidModuleLoader ModLoader; HeaderSearch HeaderInfo(new HeaderSearchOptions, SourceMgr, Diags, LangOpts, @@ -291,7 +291,7 @@ TEST_F(SourceManagerTest, isBeforeInTranslationUnitWithMacroInInclude) { const FileEntry *headerFile = FileMgr.getVirtualFile("/test-header.h", HeaderBuf->getBufferSize(), 0); - SourceMgr.overrideFileContents(headerFile, HeaderBuf.release()); + SourceMgr.overrideFileContents(headerFile, std::move(HeaderBuf)); VoidModuleLoader ModLoader; HeaderSearch HeaderInfo(new HeaderSearchOptions, SourceMgr, Diags, LangOpts, |