diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2020-12-09 14:46:34 -0800 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2020-12-14 14:35:11 -0800 |
commit | a40db5502b2515a6f2f1676b5d7a655ae0f41179 (patch) | |
tree | f304102fc337f5a49d983fcec1a05b8dd973ec5b /clang-tools-extra/modularize | |
parent | 25067f179f33ba1b764ac7a7d83385c8fd73801f (diff) | |
download | llvm-a40db5502b2515a6f2f1676b5d7a655ae0f41179.tar.gz |
Lex: Migrate HeaderSearch::LoadedModuleMaps to FileEntryRef
Migrate `HeaderSearch::LoadedModuleMaps` and a number of APIs over to
`FileEntryRef`. This should have no functionality change. Note that two
`FileEntryRef`s hash the same if they point at the same `FileEntry`.
Differential Revision: https://reviews.llvm.org/D92975
Diffstat (limited to 'clang-tools-extra/modularize')
-rw-r--r-- | clang-tools-extra/modularize/ModularizeUtilities.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang-tools-extra/modularize/ModularizeUtilities.cpp b/clang-tools-extra/modularize/ModularizeUtilities.cpp index 200370c135df..7470c324bbdb 100644 --- a/clang-tools-extra/modularize/ModularizeUtilities.cpp +++ b/clang-tools-extra/modularize/ModularizeUtilities.cpp @@ -258,22 +258,22 @@ std::error_code ModularizeUtilities::loadProblemHeaderList( std::error_code ModularizeUtilities::loadModuleMap( llvm::StringRef InputPath) { // Get file entry for module.modulemap file. - auto ModuleMapEntryOrErr = - SourceMgr->getFileManager().getFile(InputPath); + auto ExpectedModuleMapEntry = + SourceMgr->getFileManager().getFileRef(InputPath); // return error if not found. - if (!ModuleMapEntryOrErr) { + if (!ExpectedModuleMapEntry) { llvm::errs() << "error: File \"" << InputPath << "\" not found.\n"; - return ModuleMapEntryOrErr.getError(); + return errorToErrorCode(ExpectedModuleMapEntry.takeError()); } - const FileEntry *ModuleMapEntry = *ModuleMapEntryOrErr; + FileEntryRef ModuleMapEntry = *ExpectedModuleMapEntry; // Because the module map parser uses a ForwardingDiagnosticConsumer, // which doesn't forward the BeginSourceFile call, we do it explicitly here. DC.BeginSourceFile(*LangOpts, nullptr); // Figure out the home directory for the module map file. - const DirectoryEntry *Dir = ModuleMapEntry->getDir(); + const DirectoryEntry *Dir = ModuleMapEntry.getDir(); StringRef DirName(Dir->getName()); if (llvm::sys::path::filename(DirName) == "Modules") { DirName = llvm::sys::path::parent_path(DirName); |