Summary: If a module was unavailable (either a missing requirement on the module being imported, or a missing file anywhere in the top-level module (and not dominated by an unsatisfied `requires`)), we would silently treat inclusions as textual. This would cause all manner of crazy and confusing errors (and would also silently "work" sometimes, making the problem difficult to track down). I'm really not a fan of the `M->isAvailable(getLangOpts(), getTargetInfo(), Requirement, MissingHeader)` function; it seems to do too many things at once, but for now I've done things in a sort of awkward way. The changes to test/Modules/Inputs/declare-use/module.map were necessitated because the thing that was meant to be tested there (introduced in r197805) was predicated on silently falling back to textual inclusion, which we no longer do. The changes to test/Modules/Inputs/macro-reexport/module.modulemap are just an overlooked missing header that seems to have been missing since this code was committed (r213922), which is now caught. Reviewers: rsmith, benlangmuir, djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10423 llvm-svn: 245228
76 lines
825 B
Plaintext
76 lines
825 B
Plaintext
module XA {
|
|
header "a.h"
|
|
}
|
|
|
|
module XB {
|
|
module B { header "b.h" }
|
|
}
|
|
|
|
module XC {
|
|
header "c.h"
|
|
use XA
|
|
// Intentionally doesn't use XB to show that -fdecl-use isn't transitive.
|
|
}
|
|
|
|
module XD {
|
|
header "d.h"
|
|
use XA
|
|
// Intentionally doesn't use XB to show that -fdecl-use isn't transitive.
|
|
}
|
|
|
|
module XE {
|
|
header "e.h"
|
|
use XA
|
|
use XB
|
|
}
|
|
|
|
module XF {
|
|
header "f.h"
|
|
use XA
|
|
use XB
|
|
}
|
|
|
|
module XG {
|
|
header "g.h"
|
|
header "g1.h"
|
|
use XC
|
|
use XE
|
|
use XJ
|
|
use XK
|
|
use XN
|
|
}
|
|
|
|
module XH {
|
|
module H { header "h.h" }
|
|
header "h1.h"
|
|
header "s.h"
|
|
use XC
|
|
use XE
|
|
}
|
|
|
|
module XJ {
|
|
header "j.h"
|
|
}
|
|
|
|
module XK {
|
|
textual header "k.h"
|
|
}
|
|
|
|
module XL {
|
|
textual header "l.h"
|
|
}
|
|
|
|
module XM {
|
|
private textual header "m.h"
|
|
textual header "m2.h"
|
|
}
|
|
|
|
module XN {
|
|
module sub {
|
|
header "sub.h"
|
|
}
|
|
}
|
|
|
|
module XS {
|
|
}
|