aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Tooling/RefactoringTest.cpp
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2016-11-07 18:40:41 +0000
committerEric Liu <ioeric@google.com>2016-11-07 18:40:41 +0000
commit6b3a7ccc7cb6f389b25576af9844e08fb32e41d4 (patch)
tree46bbfd252f98ab1c07eeb2cdd3b04e3f25ed222d /clang/unittests/Tooling/RefactoringTest.cpp
parent986480032b4bce6884c49fc4f786d5d6df031603 (diff)
downloadllvm-6b3a7ccc7cb6f389b25576af9844e08fb32e41d4.zip
llvm-6b3a7ccc7cb6f389b25576af9844e08fb32e41d4.tar.gz
llvm-6b3a7ccc7cb6f389b25576af9844e08fb32e41d4.tar.bz2
Fix memory leak caused by r286096.
llvm-svn: 286132
Diffstat (limited to 'clang/unittests/Tooling/RefactoringTest.cpp')
-rw-r--r--clang/unittests/Tooling/RefactoringTest.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/unittests/Tooling/RefactoringTest.cpp b/clang/unittests/Tooling/RefactoringTest.cpp
index 31b14ea..c9149a2 100644
--- a/clang/unittests/Tooling/RefactoringTest.cpp
+++ b/clang/unittests/Tooling/RefactoringTest.cpp
@@ -977,7 +977,7 @@ TEST(DeduplicateByFileTest, PathsWithDots) {
std::map<std::string, Replacements> FileToReplaces;
llvm::IntrusiveRefCntPtr<vfs::InMemoryFileSystem> VFS(
new vfs::InMemoryFileSystem());
- FileManager *FileMgr = new FileManager(FileSystemOptions(), VFS);
+ FileManager FileMgr(FileSystemOptions(), VFS);
#if !defined(LLVM_ON_WIN32)
StringRef Path1 = "a/b/.././c.h";
StringRef Path2 = "a/c.h";
@@ -989,7 +989,7 @@ TEST(DeduplicateByFileTest, PathsWithDots) {
EXPECT_TRUE(VFS->addFile(Path2, 0, llvm::MemoryBuffer::getMemBuffer("")));
FileToReplaces[Path1] = Replacements();
FileToReplaces[Path2] = Replacements();
- FileToReplaces = groupReplacementsByFile(*FileMgr, FileToReplaces);
+ FileToReplaces = groupReplacementsByFile(FileMgr, FileToReplaces);
EXPECT_EQ(1u, FileToReplaces.size());
EXPECT_EQ(Path1, FileToReplaces.begin()->first);
}
@@ -998,7 +998,7 @@ TEST(DeduplicateByFileTest, PathWithDotSlash) {
std::map<std::string, Replacements> FileToReplaces;
llvm::IntrusiveRefCntPtr<vfs::InMemoryFileSystem> VFS(
new vfs::InMemoryFileSystem());
- FileManager *FileMgr = new FileManager(FileSystemOptions(), VFS);
+ FileManager FileMgr(FileSystemOptions(), VFS);
#if !defined(LLVM_ON_WIN32)
StringRef Path1 = "./a/b/c.h";
StringRef Path2 = "a/b/c.h";
@@ -1010,7 +1010,7 @@ TEST(DeduplicateByFileTest, PathWithDotSlash) {
EXPECT_TRUE(VFS->addFile(Path2, 0, llvm::MemoryBuffer::getMemBuffer("")));
FileToReplaces[Path1] = Replacements();
FileToReplaces[Path2] = Replacements();
- FileToReplaces = groupReplacementsByFile(*FileMgr, FileToReplaces);
+ FileToReplaces = groupReplacementsByFile(FileMgr, FileToReplaces);
EXPECT_EQ(1u, FileToReplaces.size());
EXPECT_EQ(Path1, FileToReplaces.begin()->first);
}
@@ -1019,7 +1019,7 @@ TEST(DeduplicateByFileTest, NonExistingFilePath) {
std::map<std::string, Replacements> FileToReplaces;
llvm::IntrusiveRefCntPtr<vfs::InMemoryFileSystem> VFS(
new vfs::InMemoryFileSystem());
- FileManager *FileMgr = new FileManager(FileSystemOptions(), VFS);
+ FileManager FileMgr(FileSystemOptions(), VFS);
#if !defined(LLVM_ON_WIN32)
StringRef Path1 = "./a/b/c.h";
StringRef Path2 = "a/b/c.h";
@@ -1029,7 +1029,7 @@ TEST(DeduplicateByFileTest, NonExistingFilePath) {
#endif
FileToReplaces[Path1] = Replacements();
FileToReplaces[Path2] = Replacements();
- FileToReplaces = groupReplacementsByFile(*FileMgr, FileToReplaces);
+ FileToReplaces = groupReplacementsByFile(FileMgr, FileToReplaces);
EXPECT_TRUE(FileToReplaces.empty());
}