[PATCH] [ms-cxxabi] Destroy temporary record arguments in the callee
John McCall
rjmccall at apple.com
Thu Jun 20 18:33:05 PDT 2013
On Jun 20, 2013, at 7:05 AM, Reid Kleckner <rnk at google.com> wrote:
> - Fix and expand the Sema test case
> - Expand comment
+ /// \brief Are temporary objects passed by value to a call destroyed by the
+ /// callee? This is a fundamental language change, since it implies that
+ /// objects passed by value do *not* live to the end of the full expression.
+ /// Temporaries passed to a function taking a const reference live to the end
+ /// of the full expression as usual. Both the caller and the callee must have
+ /// access to the destructor, while only the caller needs the destructor if
+ /// this is false.
This is not \brief. :)
+ bool isTemporaryDestroyedByCallee() const {
Let's call this isArgumentDestroyedByCallee(). It's understood that it only
applies to by-value arguments.
+ bool HasAggregateEvalKind = hasAggregateEvaluationKind(type);
Leave a blank line after this so it doesn't run into the comment.
+ if (getTarget().getCXXABI().isTemporaryDestroyedByCallee())
It's both cheaper and more comprehensive to just check whether the
CallArgs have any cleanups we need to deactivate.
Otherwise, this looks fine.
John.
More information about the cfe-commits
mailing list