cmCxxModuleMapper: track whether modules are private or not

This allows collation to give a useful error message when it finds usage
of a private module rather than collation just not informing the
compilation and the compiler erroring out about not being able to import
unknown modules (which exists, but it was not told about due to
visibility).

Fixes: #24652
This commit is contained in:
Ben Boeckel
2023-05-14 17:24:02 -04:00
committed by Brad King
parent 56f7d6f827
commit 18f87c87f8
3 changed files with 78 additions and 36 deletions
+2 -3
View File
@@ -50,12 +50,11 @@ struct CxxModuleLocations
std::function<std::string(std::string)> PathForGenerator;
// Lookup the BMI location of a logical module name.
std::function<cm::optional<std::string>(std::string const&)>
BmiLocationForModule;
std::function<CxxBmiLocation(std::string const&)> BmiLocationForModule;
// Returns the generator path (if known) for the BMI given a
// logical module name.
cm::optional<std::string> BmiGeneratorPathForModule(
CxxBmiLocation BmiGeneratorPathForModule(
std::string const& logical_name) const;
};