jyu2 added a comment.

I changed!  Thank you do much.  Upload new patch.



================
Comment at: lib/CodeGen/MicrosoftCXXABI.cpp:1530-1532
+    const CXXRecordDecl *ClassDecl =
+             cast<CXXConstructorDecl>(CGF.CurCodeDecl)->getParent();
+    if (ClassDecl != nullptr && ClassDecl->getNumVBases())
----------------
rnk wrote:
> jyu2 wrote:
> > rnk wrote:
> > > These checks seem unnecessary. ForVirtualBase should never be true if 
> > > there are no vbases, and the IsMostDerivedClass assert will catch it if 
> > > not.
> > Yes, you are right.  I can either check here, or check if 
> > IsMostDerivedClass is nullptr return instead assertion inside 
> > EmitDtorCompleteObjectHandler.
> > 
> > As you know ForVirutalBase is set also for destructor.  But we only need 
> > this for ctor.  
> > 
> > 
> Yes, the first if check is necessary, but the second check for `ClassDecl != 
> nullptr && ClassDecl->getNumVBases()` should never be false when 
> ForVirtualBase is true.
Yes, make sense!! I don't know what I was think.  Changed.   


Repository:
  rL LLVM

https://reviews.llvm.org/D27358



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to