================
@@ -222,6 +230,41 @@ struct ModuleAttributes {
         NoUndeclaredIncludes(false) {}
 };
 
+/// A reference to either a fully materialized Module object, or
+/// a yet-to-be-deserialized submodule in an AST file.
+class ModuleRef {
+  mutable Module *Existing = nullptr;
+  mutable ExternalSubmoduleSource *ExternalSource = nullptr;
----------------
jansvoboda11 wrote:

I don't this so, because I want `ModuleRef` to represent either the 
materialized `Module *`, or the external submodule in `ASTReader`, or _both_.

This will become useful in a later patch, where even if a `Module *` gets 
deserialized/materialized from an AST file, the `ExternalSubmoduleSource` is 
still able to give me some information for `SubmoduleID` more efficiently than 
the `Module *` object can. (More specifically - get me the set of _exported_ 
`ModuleRef`s without fully deserializing imports, submodules, etc. that `Module 
*` would trigger.)

https://github.com/llvm/llvm-project/pull/194968
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to