Timm =?utf-8?q?Bäder?= <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


================
@@ -5625,25 +5650,24 @@ bool Compiler<Emitter>::visitAPValueInitializer(const 
APValue &Val,
       }
     }
 
-    // Bases.
-    for (unsigned I = 0, N = Val.getStructNumBases(); I != N; ++I) {
-      // FIXME: APValue doesn't know about virtual bases.
-      //   We simply assume that if the APValue has more bases than the Record,
-      //   those additional bases must be virtual.
-      if (I >= R->getNumBases())
-        break;
-      const APValue &B = Val.getStructBase(I);
-      if (B.isIndeterminate())
-        continue;
-      const Record::Base *RB = R->getBase(I);
-      QualType BaseType = Ctx.getASTContext().getCanonicalTagType(RB->Decl);
+    // Virtual Bases.
+    if (IsCompleteClass) {
+      for (unsigned I = 0, N = Val.getStructNumVirtualBases(); I != N; ++I) {
+        const APValue &B = Val.getStructVirtualBase(I);
+        if (B.isIndeterminate())
+          continue;
+        const Record::Base *RB = R->getVirtualBase(I);
+        QualType BaseType = Ctx.getASTContext().getCanonicalTagType(RB->Decl);
 
-      if (!this->emitGetPtrBase(RB->Offset, Info))
-        return false;
-      if (!this->visitAPValueInitializer(B, Info, BaseType))
-        return false;
-      if (!this->emitFinishInitPop(Info))
-        return false;
+        if (!this->emitGetPtrVirtBase(cast<CXXRecordDecl>(RB->R->getDecl()),
----------------
yronglin wrote:

Does `VirtBase` a naming convention in bytecode? Because both `VirtBase` and 
`VirtualBase` exist in the code.

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

Reply via email to