This is an archive of the discontinued LLVM Phabricator instance.

[MC] Clean up unused inline function and non-anchor defaulted destructors; NFCI
ClosedPublic

Authored by hubert.reinterpretcast on Jan 24 2019, 12:42 PM.

Details

Summary

Take care of some missing clean-ups that belong with r249548 and some other copy/paste that had happened. In particular, the destructors are no longer vtable anchors after r249548; and setSectionName in MCSectionWasm is private and unused since r313058 culled its only caller. The destructors are now implicitly defined, and the unused function is removed.

Diff Detail

Repository
rL LLVM

Event Timeline

This looks to me like the right thing to do but I added Jim Grosbach as a reviewer since he owns the MC layer.

sbc100 added inline comments.Jan 28 2019, 12:26 PM
lib/MC/MCSectionCOFF.cpp
17 ↗(On Diff #183371)

If its not longer an anchor then presumably it can be removed from the .cpp file? And in fact since its empty removed from the .h file too?

Ditto for ELF and wasm files.

hubert.reinterpretcast marked an inline comment as done.Jan 28 2019, 4:40 PM
hubert.reinterpretcast added inline comments.
lib/MC/MCSectionCOFF.cpp
17 ↗(On Diff #183371)

Yes, I think I will do that. It does not look like these destructors do much other than calling the base destructor, and the base destructor is already out-of-line.

Address comments: Let public defaulted destructors be implicitly defined

Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2019, 10:03 AM
nemanjai accepted this revision.Feb 4 2019, 10:50 AM

LGTM. Maybe give it a couple of days in case someone else has an objection.

This revision is now accepted and ready to land.Feb 4 2019, 10:50 AM

lgtm.

I assume its safe to remove the destructors here as they were only used for anchors and these class have other virtual functions in the cpp files already. The rules for anchor methods are here: https://llvm.org/docs/CodingStandards.html#provide-a-virtual-method-anchor-for-classes-in-headers.

hubert.reinterpretcast retitled this revision from [MC] Remove unused inline function and stale comments; NFC to [MC] Clean up unused inline function and non-anchor defaulted destructors; NFCI.Feb 8 2019, 6:04 PM
hubert.reinterpretcast edited the summary of this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.