Mimic the behavior of including headers where a system includer makes an
includee a system header too.
rdar://84049469
Paths
| Differential D111476
[modules] Make a module map referenced by a system map a system one too. ClosedPublic Authored by vsapsai on Oct 8 2021, 5:17 PM.
Details Summary Mimic the behavior of including headers where a system includer makes an rdar://84049469
Diff Detail
Event TimelineComment Actions Used the mechanism simpler than the one with headers on purpose. // The #included file will be considered to be a system header if either it is // in a system include directory, or if the #includer is a system include // header. SrcMgr::CharacteristicKind FileCharacter = SourceMgr.getFileCharacteristic(FilenameTok.getLocation()); if (File) FileCharacter = std::max(HeaderInfo.getFileDirFlavor(&File->getFileEntry()), FileCharacter); We aren't doing general-purpose module map search, only extern module maps based on relative or absolute paths. In practice we don't see system and non-system maps referencing each other, so I think anything more complicated isn't really justified. Though if people think we shouldn't propagate IsSystem for absolute paths, I'm fine with that complication. This revision is now accepted and ready to land.Oct 15 2021, 7:34 AM Closed by commit rGd0e7bdc20849: [modules] Make a module map referenced by a system map a system one too. (authored by vsapsai). · Explain WhyOct 15 2021, 12:47 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 380084 clang/lib/Lex/ModuleMap.cpp
clang/test/Modules/fmodules-validate-once-per-build-session.c
|