[clang] [C++20][Modules] Implement P1857R3 Modules Dependency Discovery (PR #107168)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 1 07:12:45 PDT 2025


================
@@ -1776,6 +1801,22 @@ class Preprocessor {
   /// Lex the parameters for an #embed directive, returns nullopt on error.
   std::optional<LexEmbedParametersResult> LexEmbedParameters(Token &Current,
                                                              bool ForHasEmbed);
+  bool LexModuleNameContinue(Token &Tok, SourceLocation UseLoc,
+                             SmallVectorImpl<Token> &Suffix,
+                             SmallVectorImpl<IdentifierLoc> &Path,
+                             bool AllowMacroExpansion = true);
+  void EnterModuleSuffixTokenStream(ArrayRef<Token> Toks);
+  void HandleCXXImportDirective(Token Import);
+  void HandleCXXModuleDirective(Token Module);
+
+  /// Callback invoked when the lexer sees one of export, import or module token
+  /// at the start of a line.
+  ///
+  /// This consumes the import, module directive, modifies the
----------------
cor3ntin wrote:

```suggestion
  /// This consumes the import/module directive, modifies the
```

https://github.com/llvm/llvm-project/pull/107168


More information about the cfe-commits mailing list