LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 20507 - if a module is unavailable, do not silently treat a #include of one of its headers as a textual include
Summary: if a module is unavailable, do not silently treat a #include of one of its he...
Status: NEW
Alias: None
Product: clang
Classification: Unclassified
Component: Modules (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
: 21216 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-07-31 21:12 PDT by Richard Smith
Modified: 2015-11-05 12:44 PST (History)
5 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Smith 2014-07-31 21:12:14 PDT
If a module is unavailable, and we see a #include of one of its headers, we silently textually include that header, which will lead to very difficult to diagnose compilation performance problems, weird errors while compiling, and so on.

We should error on this case.
Comment 1 Vassil Vassilev 2014-09-09 04:42:06 PDT
Could you spell out what unavailable means here? Is it module.map available/read but for some reason falling back to textual header?
Comment 2 Richard Smith 2014-09-15 17:03:51 PDT
(In reply to comment #1)
> Could you spell out what unavailable means here? Is it module.map
> available/read but for some reason falling back to textual header?

"unavailable" means that we can't build the module for some reason. That can be because it names a header that does not exist, or because it says "requires blah" and we don't have feature 'blah', or possibly other reasons I forgot =)
Comment 3 Richard Smith 2014-10-16 20:43:45 PDT
*** Bug 21216 has been marked as a duplicate of this bug. ***
Comment 4 Vassil Vassilev 2014-10-17 05:48:07 PDT
I have a patch diagnosing missing headers. It does while parsing the module map, at the end of parsing a module definition. Is this the right place or it should be somewhere else?
Comment 5 Louis Brandy 2015-11-05 12:44:32 PST
This keeps hitting me as well while modularizing. I somehow muck up something in the module map, the module disappears silently and everything reverts to textual inclusion and it takes me awhile to notice and backtrack. Did you post a patch somewhere Vassil? I'm very a much newb as well but having some kind of diagnostic for this would be great.