[clang] f263dac - [clang][parse] NFCI: Use FileEntryRef in Parser::ParseModuleImport()

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 15 06:16:23 PDT 2022


Author: Jan Svoboda
Date: 2022-04-15T15:16:17+02:00
New Revision: f263dac4465c251e37af9787baf5e9f56138e369

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

LOG: [clang][parse] NFCI: Use FileEntryRef in Parser::ParseModuleImport()

This patch removes use of the deprecated `DirectoryEntry::getName()` from `Parser` by using `{File,Directory}EntryRef` instead.

Reviewed By: bnbarham

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

Added: 
    

Modified: 
    clang/lib/Parse/Parser.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index 2550cdd9f5bbf..2aaaa29af18f7 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -2518,8 +2518,8 @@ Decl *Parser::ParseModuleImport(SourceLocation AtLoc,
   // the header is parseable. Emit a warning to make the user aware.
   if (IsObjCAtImport && AtLoc.isValid()) {
     auto &SrcMgr = PP.getSourceManager();
-    auto *FE = SrcMgr.getFileEntryForID(SrcMgr.getFileID(AtLoc));
-    if (FE && llvm::sys::path::parent_path(FE->getDir()->getName())
+    auto FE = SrcMgr.getFileEntryRefForID(SrcMgr.getFileID(AtLoc));
+    if (FE && llvm::sys::path::parent_path(FE->getDir().getName())
                   .endswith(".framework"))
       Diags.Report(AtLoc, diag::warn_atimport_in_framework_header);
   }


        


More information about the cfe-commits mailing list