diff options
author | James Y Knight <jyknight@google.com> | 2025-07-31 09:57:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-31 09:57:13 -0400 |
commit | 9ddbb478ce11e43ae18aa6d04937a51621021482 (patch) | |
tree | 5f5462a6ff5f890d968c2aff79673fb8c62c169b /clang/unittests/Tooling/RefactoringTest.cpp | |
parent | 920d5bbf0d3fff3bc0953957b896055ea653628c (diff) | |
download | llvm-9ddbb478ce11e43ae18aa6d04937a51621021482.zip llvm-9ddbb478ce11e43ae18aa6d04937a51621021482.tar.gz llvm-9ddbb478ce11e43ae18aa6d04937a51621021482.tar.bz2 |
NFC: Clean up construction of IntrusiveRefCntPtr from raw pointers for llvm::vfs::FileSystem. (#151407)
This switches to `makeIntrusiveRefCnt<FileSystem>` where creating a new
object, and to passing/returning by `IntrusiveRefCntPtr<FileSystem>`
instead of `FileSystem*` or `FileSystem&`, when dealing with existing
objects.
Part of cleanup #151026.
Diffstat (limited to 'clang/unittests/Tooling/RefactoringTest.cpp')
-rw-r--r-- | clang/unittests/Tooling/RefactoringTest.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/clang/unittests/Tooling/RefactoringTest.cpp b/clang/unittests/Tooling/RefactoringTest.cpp index 35d1143..aff7523e 100644 --- a/clang/unittests/Tooling/RefactoringTest.cpp +++ b/clang/unittests/Tooling/RefactoringTest.cpp @@ -1035,8 +1035,7 @@ static constexpr bool usesWindowsPaths() { TEST(DeduplicateByFileTest, PathsWithDots) { std::map<std::string, Replacements> FileToReplaces; - llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> VFS( - new llvm::vfs::InMemoryFileSystem()); + auto VFS = llvm::makeIntrusiveRefCnt<llvm::vfs::InMemoryFileSystem>(); FileManager FileMgr(FileSystemOptions(), VFS); StringRef Path1 = usesWindowsPaths() ? "a\\b\\..\\.\\c.h" : "a/b/.././c.h"; StringRef Path2 = usesWindowsPaths() ? "a\\c.h" : "a/c.h"; @@ -1051,8 +1050,7 @@ TEST(DeduplicateByFileTest, PathsWithDots) { TEST(DeduplicateByFileTest, PathWithDotSlash) { std::map<std::string, Replacements> FileToReplaces; - llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> VFS( - new llvm::vfs::InMemoryFileSystem()); + auto VFS = llvm::makeIntrusiveRefCnt<llvm::vfs::InMemoryFileSystem>(); FileManager FileMgr(FileSystemOptions(), VFS); StringRef Path1 = usesWindowsPaths() ? ".\\a\\b\\c.h" : "./a/b/c.h"; StringRef Path2 = usesWindowsPaths() ? "a\\b\\c.h" : "a/b/c.h"; @@ -1067,8 +1065,7 @@ TEST(DeduplicateByFileTest, PathWithDotSlash) { TEST(DeduplicateByFileTest, NonExistingFilePath) { std::map<std::string, Replacements> FileToReplaces; - llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> VFS( - new llvm::vfs::InMemoryFileSystem()); + auto VFS = llvm::makeIntrusiveRefCnt<llvm::vfs::InMemoryFileSystem>(); FileManager FileMgr(FileSystemOptions(), VFS); StringRef Path1 = usesWindowsPaths() ? ".\\a\\b\\c.h" : "./a/b/c.h"; StringRef Path2 = usesWindowsPaths() ? "a\\b\\c.h" : "a/b/c.h"; |