diff options
author | dim <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
commit | c86b984ea8ecb3e944dc3de48539f4c1f65851ea (patch) | |
tree | 3eb853da77d46cc77c4b017525a422f9ddb1385b /unittests/Basic/SourceManagerTest.cpp | |
parent | c696171ff15f0ee60dea4abfd99a135473c95656 (diff) | |
download | FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.zip FreeBSD-src-c86b984ea8ecb3e944dc3de48539f4c1f65851ea.tar.gz |
Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc1@226102
Diffstat (limited to 'unittests/Basic/SourceManagerTest.cpp')
-rw-r--r-- | unittests/Basic/SourceManagerTest.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/unittests/Basic/SourceManagerTest.cpp b/unittests/Basic/SourceManagerTest.cpp index 9ea093c..1dda54d 100644 --- a/unittests/Basic/SourceManagerTest.cpp +++ b/unittests/Basic/SourceManagerTest.cpp @@ -74,8 +74,8 @@ TEST_F(SourceManagerTest, isBeforeInTranslationUnit) { const char *source = "#define M(x) [x]\n" "M(foo)"; - MemoryBuffer *buf = MemoryBuffer::getMemBuffer(source); - FileID mainFileID = SourceMgr.createFileID(buf); + std::unique_ptr<MemoryBuffer> Buf = MemoryBuffer::getMemBuffer(source); + FileID mainFileID = SourceMgr.createFileID(std::move(Buf)); SourceMgr.setMainFileID(mainFileID); VoidModuleLoader ModLoader; @@ -127,8 +127,8 @@ TEST_F(SourceManagerTest, getColumnNumber) { "int x;\n" "int y;"; - MemoryBuffer *Buf = MemoryBuffer::getMemBuffer(Source); - FileID MainFileID = SourceMgr.createFileID(Buf); + std::unique_ptr<MemoryBuffer> Buf = MemoryBuffer::getMemBuffer(Source); + FileID MainFileID = SourceMgr.createFileID(std::move(Buf)); SourceMgr.setMainFileID(MainFileID); bool Invalid; @@ -186,14 +186,14 @@ TEST_F(SourceManagerTest, getMacroArgExpandedLocation) { "#define CONCAT(X, Y) X##Y\n" "CONCAT(1,1)\n"; - MemoryBuffer *headerBuf = MemoryBuffer::getMemBuffer(header); - MemoryBuffer *mainBuf = MemoryBuffer::getMemBuffer(main); - FileID mainFileID = SourceMgr.createFileID(mainBuf); + std::unique_ptr<MemoryBuffer> HeaderBuf = MemoryBuffer::getMemBuffer(header); + std::unique_ptr<MemoryBuffer> MainBuf = MemoryBuffer::getMemBuffer(main); + FileID mainFileID = SourceMgr.createFileID(std::move(MainBuf)); SourceMgr.setMainFileID(mainFileID); const FileEntry *headerFile = FileMgr.getVirtualFile("/test-header.h", - headerBuf->getBufferSize(), 0); - SourceMgr.overrideFileContents(headerFile, headerBuf); + HeaderBuf->getBufferSize(), 0); + SourceMgr.overrideFileContents(headerFile, std::move(HeaderBuf)); VoidModuleLoader ModLoader; HeaderSearch HeaderInfo(new HeaderSearchOptions, SourceMgr, Diags, LangOpts, @@ -285,13 +285,13 @@ TEST_F(SourceManagerTest, isBeforeInTranslationUnitWithMacroInInclude) { "#define INC2 </test-header.h>\n" "#include M(INC2)\n"; - MemoryBuffer *headerBuf = MemoryBuffer::getMemBuffer(header); - MemoryBuffer *mainBuf = MemoryBuffer::getMemBuffer(main); - SourceMgr.setMainFileID(SourceMgr.createFileID(mainBuf)); + std::unique_ptr<MemoryBuffer> HeaderBuf = MemoryBuffer::getMemBuffer(header); + std::unique_ptr<MemoryBuffer> MainBuf = MemoryBuffer::getMemBuffer(main); + SourceMgr.setMainFileID(SourceMgr.createFileID(std::move(MainBuf))); const FileEntry *headerFile = FileMgr.getVirtualFile("/test-header.h", - headerBuf->getBufferSize(), 0); - SourceMgr.overrideFileContents(headerFile, headerBuf); + HeaderBuf->getBufferSize(), 0); + SourceMgr.overrideFileContents(headerFile, std::move(HeaderBuf)); VoidModuleLoader ModLoader; HeaderSearch HeaderInfo(new HeaderSearchOptions, SourceMgr, Diags, LangOpts, @@ -303,7 +303,7 @@ TEST_F(SourceManagerTest, isBeforeInTranslationUnitWithMacroInInclude) { PP.Initialize(*Target); std::vector<MacroAction> Macros; - PP.addPPCallbacks(new MacroTracker(Macros)); + PP.addPPCallbacks(llvm::make_unique<MacroTracker>(Macros)); PP.EnterMainSourceFile(); |