[llvm-branch-commits] [clang] b4f4fc6 - ASTImporter: Migrate to the FileEntryRef overload of SourceManager::createFileID, NFC

Duncan P. N. Exon Smith via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Dec 4 14:53:54 PST 2020


Author: Duncan P. N. Exon Smith
Date: 2020-12-04T14:45:59-08:00
New Revision: b4f4fc6872fbe4e296d3270d297a0e4afbda6670

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

LOG: ASTImporter: Migrate to the FileEntryRef overload of SourceManager::createFileID, NFC

Migrate `ASTImporter::Import` over to using the `FileEntryRef` overload
of `SourceManager::createFileID`. No functionality change here.

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

Added: 
    

Modified: 
    clang/lib/AST/ASTImporter.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index a74e316f688e6..50632efc281ff 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/lib/AST/ASTImporter.cpp
@@ -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.


        


More information about the llvm-branch-commits mailing list