ASTImporter: Migrate to the FileEntryRef overload of SourceManager::createFileID...
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 3 Dec 2020 01:25:46 +0000 (17:25 -0800)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 4 Dec 2020 22:45:59 +0000 (14:45 -0800)
Migrate `ASTImporter::Import` over to using the `FileEntryRef` overload
of `SourceManager::createFileID`. No functionality change here.

Differential Revision: https://reviews.llvm.org/D92529

clang/lib/AST/ASTImporter.cpp

index a74e316..50632ef 100644 (file)
@@ -8719,7 +8719,7 @@ Expected<FileID> ASTImporter::Import(FileID FromID, bool IsBuiltin) {
         // FIXME: We definitely want to re-use the existing MemoryBuffer, rather
         // than mmap the files several times.
         auto Entry =
-            ToFileManager.getFile(Cache->OrigEntry->getName());
+            ToFileManager.getOptionalFileRef(Cache->OrigEntry->getName());
         // FIXME: The filename may be a virtual name that does probably not
         // point to a valid file and we get no Entry here. In this case try with
         // the memory buffer below.