This is an archive of the discontinued LLVM Phabricator instance.

[clang][modules][deps] Report modulemaps describing excluded headers
ClosedPublic

Authored by jansvoboda11 on Sep 19 2022, 2:23 PM.

Details

Summary

Module map files describing excluded headers do affect compilation. Track them in the compiler, serialize them into the PCM file and report them in the scanner.

Depends on D134222.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Sep 19 2022, 2:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2022, 2:23 PM
Herald added a subscriber: ributzka. · View Herald Transcript
jansvoboda11 requested review of this revision.Sep 19 2022, 2:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2022, 2:23 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Fix failing test by undoing some API changes

I think this is fine, but I need to think more about the ModuleDepCollector.cpp change.

clang/lib/Lex/ModuleMap.cpp
1275

Cast to void no longer needed.

Bigcheese accepted this revision.Sep 22 2022, 11:00 AM

lgtm with formatting fixed.

This revision is now accepted and ready to land.Sep 22 2022, 11:00 AM
This revision was landed with ongoing or failed builds.Sep 22 2022, 12:36 PM
This revision was automatically updated to reflect the committed changes.
srj added a subscriber: srj.Sep 23 2022, 9:43 AM

This change has broken x86-32 builds, at least on Linux.

/usr/local/google/home/srj/GitHub/llvm-project/16/llvm/include/llvm/ADT/PointerIntPair.h:136:25: error: static assertion failed: PointerIntPair with integer size too large for pointer
  136 |   static_assert(IntBits <= PtrTraits::NumLowBitsAvailable,
      |                 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/google/home/srj/GitHub/llvm-project/16/llvm/include/llvm/ADT/PointerIntPair.h:136:25: note: the comparison reduces to ‘(3 <= 2)’
/usr/local/google/home/srj/GitHub/llvm-project/16/llvm/include/llvm/ADT/PointerIntPair.h:151:42: warning: left shift count >= width of type [-Wshift-count-overflow]
  151 |     ShiftedIntMask = (uintptr_t)(IntMask << IntShift)
      |                                 ~~~~~~~~~^~~~~~~~~~~~
/usr/local/google/home/srj/GitHub/llvm-project/16/llvm/include/llvm/ADT/PointerIntPair.h:151:42: error: right operand of shift expression ‘(7 << 4294967295)’ is greater than or equal to the precision 32 of the left operand [-fpermissive]
/usr/local/google/home/srj/GitHub/llvm-project/16/llvm/include/llvm/ADT/PointerIntPair.h:138:8: error: enumerator value for ‘ShiftedIntMask’ is not an integer constant
  138 |   enum MaskAndShiftConstants : uintptr_t {

Please fix or revert immediately.

mgorny added a subscriber: mgorny.Sep 26 2022, 2:44 AM