nmusgrave added inline comments.

================
Comment at: lib/CodeGen/CGCXX.cpp:41
@@ +40,3 @@
+  if (getCodeGenOpts().SanitizeMemoryUseAfterDtor && Layout.getFieldCount() > 0
+      && HasTrivialDestructorBody(Context, D->getParent(), D->getParent())) {
+        return true;
----------------
nmusgrave wrote:
> eugenis wrote:
> > I'm not sure this is correct. It says not to use an alias if D has trivial 
> > body. Should not it be the other way around?
> It's counter-intuitive:
> TryEmitBaseDestructorAsAlias returns false when TryEmitDefinitionAsAlias 
> returns false.
> TryEmitDefinitionAsAlias returns false when an alias is successfully created 
> (line 216 in this CL)
For example: line 3711 of clang/lib/CodeGen/MicrosoftCXXABI.cpp
 bool ProducedAlias = !CGM.TryEmitDefinitionAsAlias(
    GlobalDecl(dtor, Dtor_Complete), GlobalDecl(dtor, Dtor_Base), true); 

^uses the negation of the function's return value


http://reviews.llvm.org/D12022



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

Reply via email to