[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 21 00:46:20 PST 2025


================
@@ -537,17 +537,14 @@ class ASTReader
   /// namespace as if it is not delayed.
   DelayedNamespaceOffsetMapTy DelayedNamespaceOffsetMap;
 
-  /// Mapping from FunctionDecl IDs to the corresponding lambda IDs.
-  ///
-  /// These lambdas have to be loaded right after the function they belong to.
-  /// It is required to have canonical declaration for lambda class from the
-  /// same module as enclosing function. This is required to correctly resolve
-  /// captured variables in the lambda. Without this, due to lazy
-  /// deserialization, canonical declarations for the function and lambdas can
-  /// be selected from different modules and DeclRefExprs may refer to the AST
-  /// nodes that don't exist in the function.
-  llvm::DenseMap<GlobalDeclID, SmallVector<GlobalDeclID, 4>>
-      FunctionToLambdasMap;
+  /// Mapping from main decl ID to the related decls IDs.
----------------
hokein wrote:

what is the main decl? I can image some definitions, but it would be nice to have some clarifications included in the comment.

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


More information about the cfe-commits mailing list