[clang] [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 1 18:47:08 PDT 2025


================
@@ -1392,6 +1392,20 @@ class ASTReader
 
   llvm::DenseMap<const Decl *, bool> DefinitionSource;
 
+  /// The set of extra flags about declarations that we have read from
+  /// the module file.
+  struct ExternalDeclarationBits {
+    /// Indicates if given function declaration was a definition but its body
+    /// was removed due to declaration merging.
+    bool ThisDeclarationWasADefinition : 1;
+
+    ExternalDeclarationBits() : ThisDeclarationWasADefinition(false) {}
+  };
+
+  /// A mapping from declarations to extra bits of information about this decl.
+  llvm::DenseMap<const Decl *, ExternalDeclarationBits>
----------------
ChuanqiXu9 wrote:

```suggestion
  llvm::DenseMap<const Decl *, bool>
```

nit: I think we can avoid the abstraction here.

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


More information about the cfe-commits mailing list