This is an archive of the discontinued LLVM Phabricator instance.

CGDecl: Skip static variable initializers in unreachable code
ClosedPublic

Authored by MatzeB on Jan 9 2017, 5:31 PM.

Details

Summary

This fixes http://llvm.org/PR31054

I don't know whether that is the correct fix: Are we actually allowed to skip the destructor registration if the static variable is unreachable?

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 83754.Jan 9 2017, 5:31 PM
MatzeB retitled this revision from to CGDecl: Skip static variable initializers in unreachable code.
MatzeB updated this object.
MatzeB added a reviewer: rsmith.
MatzeB set the repository for this revision to rL LLVM.
MatzeB added a subscriber: cfe-commits.
rsmith accepted this revision.Jan 9 2017, 6:09 PM
rsmith edited edge metadata.

Yes, this is correct; per [stmt.dcl]/5, the destructor only runs if the object was constructed.

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