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);
 }


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to