This is an archive of the discontinued LLVM Phabricator instance.

Sema: remove unnecessary parameter for SwiftName handling (NFCI)
ClosedPublic

Authored by compnerd on Sep 24 2020, 2:53 PM.

Details

Summary

This code never actually did anything in the implementation.

mergeDeclAttribute is declared as static, and referenced exactly
once in the file: from Sema::mergeDeclAttributes.

Sema::mergeDeclAttributes sets LocalAMK to AMK_None. If the
attribute is DeprecatedAttr, UnavailableAttr, or AvailabilityAttr
then the LocalAMK is updated. However, because we are dealing with a
SwiftNameDeclAttr here, LocalAMK remains AMK_None. This is then
passed to the function which will as a result pass the value of
AMK_None == AMK_Override aka false. Simply propagate the value
through and erase the dead codepath.

Thanks to Aaron Ballman for flagging the use of the availability merge
kind here leading to this simplification!

Diff Detail

Event Timeline

compnerd created this revision.Sep 24 2020, 2:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 24 2020, 2:53 PM
compnerd requested review of this revision.Sep 24 2020, 2:53 PM
This revision is now accepted and ready to land.Sep 25 2020, 5:26 AM