diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2023-05-26 12:24:06 -0700 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2023-05-26 15:14:16 -0700 |
commit | 924912956ed570e433440108cc50bd0ee65605b5 (patch) | |
tree | 04f8015329ec3ed8bb7c375ddaf2867feec79bf3 /clang/lib/Frontend/FrontendAction.cpp | |
parent | 7adff65d4abf4b743e3834505cdb1a580b4d966e (diff) | |
download | llvm-924912956ed570e433440108cc50bd0ee65605b5.zip llvm-924912956ed570e433440108cc50bd0ee65605b5.tar.gz llvm-924912956ed570e433440108cc50bd0ee65605b5.tar.bz2 |
[clang][modules] NFCI: Distinguish as-written and effective umbrella directories
For modules with umbrellas, we track how they were written in the module map. Unfortunately, the getter for the umbrella directory conflates the "as written" directory and the "effective" directory (either the written one or the parent of the written umbrella header).
This patch makes the distinction between "as written" and "effective" umbrella directories clearer. No functional change intended.
Reviewed By: benlangmuir
Differential Revision: https://reviews.llvm.org/D151581
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index a785ad8..bd6d1b0 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -364,13 +364,14 @@ static std::error_code collectModuleHeaderIncludes( } // Note that Module->PrivateHeaders will not be a TopHeader. - if (Module::Header UmbrellaHeader = Module->getUmbrellaHeader()) { + if (Module::Header UmbrellaHeader = Module->getUmbrellaHeaderAsWritten()) { Module->addTopHeader(UmbrellaHeader.Entry); if (Module->Parent) // Include the umbrella header for submodules. addHeaderInclude(UmbrellaHeader.PathRelativeToRootModuleDirectory, Includes, LangOpts, Module->IsExternC); - } else if (Module::DirectoryName UmbrellaDir = Module->getUmbrellaDir()) { + } else if (Module::DirectoryName UmbrellaDir = + Module->getUmbrellaDirAsWritten()) { // Add all of the headers we find in this subdirectory. std::error_code EC; SmallString<128> DirNative; @@ -550,7 +551,7 @@ getInputBufferForModule(CompilerInstance &CI, Module *M) { // Collect the set of #includes we need to build the module. SmallString<256> HeaderContents; std::error_code Err = std::error_code(); - if (Module::Header UmbrellaHeader = M->getUmbrellaHeader()) + if (Module::Header UmbrellaHeader = M->getUmbrellaHeaderAsWritten()) addHeaderInclude(UmbrellaHeader.PathRelativeToRootModuleDirectory, HeaderContents, CI.getLangOpts(), M->IsExternC); Err = collectModuleHeaderIncludes( |