[llvm-branch-commits] [clang] 75a95bc - clang-format: Migrate createInMemoryFile to FileEntryRef, NFC

Duncan P. N. Exon Smith via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 9 15:05:03 PST 2020


Author: Duncan P. N. Exon Smith
Date: 2020-12-09T15:00:53-08:00
New Revision: 75a95bc80eae0c539b342f2cb19a92a0de02d2e1

URL: https://github.com/llvm/llvm-project/commit/75a95bc80eae0c539b342f2cb19a92a0de02d2e1
DIFF: https://github.com/llvm/llvm-project/commit/75a95bc80eae0c539b342f2cb19a92a0de02d2e1.diff

LOG: clang-format: Migrate createInMemoryFile to FileEntryRef, NFC

Added: 
    

Modified: 
    clang/tools/clang-format/ClangFormat.cpp

Removed: 
    


################################################################################
diff  --git a/clang/tools/clang-format/ClangFormat.cpp b/clang/tools/clang-format/ClangFormat.cpp
index 121c9626b261..a1b42a6d0940 100644
--- a/clang/tools/clang-format/ClangFormat.cpp
+++ b/clang/tools/clang-format/ClangFormat.cpp
@@ -178,7 +178,7 @@ static FileID createInMemoryFile(StringRef FileName, MemoryBufferRef Source,
                                  SourceManager &Sources, FileManager &Files,
                                  llvm::vfs::InMemoryFileSystem *MemFS) {
   MemFS->addFileNoOwn(FileName, 0, Source);
-  auto File = Files.getFile(FileName);
+  auto File = Files.getOptionalFileRef(FileName);
   assert(File && "File not added to MemFS?");
   return Sources.createFileID(*File, SourceLocation(), SrcMgr::C_User);
 }


        


More information about the llvm-branch-commits mailing list