This is an archive of the discontinued LLVM Phabricator instance.

Lit C++11 Compatibility Patch - nonthrowing destructors
ClosedPublic

Authored by tigerleapgorge on Jan 6 2017, 5:16 PM.

Details

Summary

Hi everyone,

I am Charles Li at Sony Playstation.
I am refactoring my existing C++11 compatibility patches to make them easier to review.
This patch is a subset of the previous #11 patch (D24812)
This patch contains 7 tests.
The changes to each test are nearly identical:
LLVM IR invocation for the destructors has changed from “invoke” to “call”.

My colleague Paul Robinson has submitted a similar patch (D27936).
To quote his explanation:

"If a dtor has no interesting members, then it ends up being nothrow, which affects the generated IR.
Modify some tests to tolerate this difference between C++03 and C++11.

In C++11, a destructor without an explicit exception-spec gets an implicit exception-spec.
If the dtor has a body, the implicit exception-spec permits throwing exactly the set of types thrown by anything the dtor calls.
If the dtor doesn't have a body, use what would be the default dtor's body to determine the implicit exception-spec.
If there are no calls, the implicit exception-spec is nothrow."

Diff Detail

Repository
rL LLVM

Event Timeline

tigerleapgorge retitled this revision from to Lit C++11 Compatibility Patch - nonthrowing destructors.
tigerleapgorge updated this object.
tigerleapgorge added reviewers: rjmccall, rsmith.
tigerleapgorge added a subscriber: cfe-commits.
rjmccall accepted this revision.Jan 6 2017, 8:18 PM
rjmccall edited edge metadata.

Looks good to me.

This revision is now accepted and ready to land.Jan 6 2017, 8:18 PM
This revision was automatically updated to reflect the committed changes.