This is an archive of the discontinued LLVM Phabricator instance.

[clang][lex] NFCI: Use DirectoryEntryRef in Preprocessor::MainFileDir
ClosedPublic

Authored by jansvoboda11 on Jun 13 2022, 8:41 AM.

Details

Summary

This patch changes the type of Preprocessor::MainFileDir from const DirectoryEntry * to Optional<DirectoryEntryRef> in order to remove some calls to the deprecated DirectoryEntry::getName().

Depends on D127658.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Jun 13 2022, 8:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2022, 8:41 AM
jansvoboda11 requested review of this revision.Jun 13 2022, 8:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2022, 8:41 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jansvoboda11 retitled this revision from [clang][lex] NFCI: Use DirectoryEntryRef in MainFileDir::MainFileDir to [clang][lex] NFCI: Use DirectoryEntryRef in Preprocessor::MainFileDir.Jun 13 2022, 8:54 AM
bnbarham accepted this revision.Jun 13 2022, 11:02 AM
bnbarham added inline comments.
clang/lib/Frontend/FrontendAction.cpp
514

Same as in previous review, is this guaranteed to be set? Might be worth a comment on the field itself if so (in https://reviews.llvm.org/D127654)

This revision is now accepted and ready to land.Jun 13 2022, 11:02 AM
jansvoboda11 marked an inline comment as done.May 25 2023, 2:47 PM
jansvoboda11 added inline comments.
clang/lib/Frontend/FrontendAction.cpp
514

It is. Couple lines above we call HeaderSearch::lookupModule(), which parses the defining module map and sets the Directory.

This revision was landed with ongoing or failed builds.May 30 2023, 1:54 PM
This revision was automatically updated to reflect the committed changes.
jansvoboda11 marked an inline comment as done.