rjmccall added inline comments.

================
Comment at: lib/Sema/SemaDeclCXX.cpp:8931
+                          /*ConstArg*/ true, false, false, false, false);
+  auto *CopyCtor = cast_or_null<CXXConstructorDecl>(SMI.getMethod());
+
----------------
Sorry, I didn't realize you'd go off and write this code manually.

The way we generally handle this sort of thing is just to synthesize an 
expression in Sema that performs the copy-construction.  That way, the stdlib 
can be as crazy as it wants — default arguments on the copy-constructor or 
whatever else — and it just works.  The pattern to follow here is the code in 
Sema::BuildExceptionDeclaration, except that in your case you can completely 
dispense with faking up an OpaqueValueExpr and instead just build a DeclRefExpr 
to the actual variable.  (You could even use ActOnIdExpression for this, 
although just synthesizing the DRE shouldn't be too hard.)  Then the 
ComparisonCategoryInfo can just store expressions for each of the three (four?) 
variables, and in IRGen you just evaluate the appropriate one into the 
destination.


https://reviews.llvm.org/D45476



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATC... Richard Smith - zygoloid via Phabricator via cfe-commits
  • [PATC... Richard Smith - zygoloid via Phabricator via cfe-commits
  • [PATC... Eric Fiselier via Phabricator via cfe-commits
  • [PATC... Eric Fiselier via Phabricator via cfe-commits
  • [PATC... Eric Fiselier via Phabricator via cfe-commits
  • [PATC... Eric Fiselier via Phabricator via cfe-commits
  • [PATC... Richard Smith - zygoloid via Phabricator via cfe-commits
  • [PATC... John McCall via Phabricator via cfe-commits
  • [PATC... Eric Fiselier via Phabricator via cfe-commits
  • [PATC... Eric Fiselier via Phabricator via cfe-commits
  • [PATC... John McCall via Phabricator via cfe-commits
  • [PATC... Eric Fiselier via Phabricator via cfe-commits
    • ... John McCall via cfe-commits
      • ... Mailing List "cfe-commits" via Phabricator via cfe-commits
  • [PATC... Eric Fiselier via Phabricator via cfe-commits
    • ... Eric Fiselier via cfe-commits
  • [PATC... John McCall via Phabricator via cfe-commits
  • [PATC... Eric Fiselier via Phabricator via cfe-commits
  • [PATC... Richard Smith - zygoloid via Phabricator via cfe-commits
  • [PATC... John McCall via Phabricator via cfe-commits
  • [PATC... John McCall via Phabricator via cfe-commits

Reply via email to