================
@@ -5309,6 +5309,49 @@ class ExportDecl final : public Decl, public DeclContext 
{
   }
 };
 
+/// Represents the private module fragment of a module unit.
+///
+/// For example:
+/// \code
+///   export module A;
+///   ...
+///   module :private;   // <- this fragment
+///   int internal_only();
+/// \endcode
+class PrivateModuleFragmentDecl final : public Decl {
+  Module *Fragment;
+  SourceLocation PrivateLoc;
+
+  PrivateModuleFragmentDecl(DeclContext *DC, SourceLocation ModuleLoc,
+                            SourceLocation PrivateLoc, Module *Fragment)
+      : Decl(PrivateModuleFragment, DC, ModuleLoc), Fragment(Fragment),
+        PrivateLoc(PrivateLoc) {}
+  PrivateModuleFragmentDecl(EmptyShell Empty)
+      : Decl(PrivateModuleFragment, Empty) {}
+
+public:
+  static PrivateModuleFragmentDecl *Create(ASTContext &C, DeclContext *DC,
----------------
zwuis wrote:

Generally we add `Create` if the class has a base class `TrailingObjects`.

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

Reply via email to