[clang] [clang-repl] fix vtable symbol duplication error (closes #141039) (PR #185648)

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 12 06:13:29 PDT 2026


================
@@ -456,6 +456,11 @@ class CodeGenModule : public CodeGenTypeCache {
   /// A queue of (optional) vtables to consider emitting.
   std::vector<const CXXRecordDecl*> DeferredVTables;
 
+  /// In incremental compilation, the set of vtable classes whose vtable
+  /// definitions were emitted into a previous PTU's module. Carried forward
+  /// by moveLazyEmissionStates() so later PTUs skip re-defining them.
+  llvm::SmallPtrSet<const CXXRecordDecl *, 8> DefinedVTables;
----------------
vgvassilev wrote:

Perhaps we should name this as EmittedVTables. 

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


More information about the cfe-commits mailing list