This is an archive of the discontinued LLVM Phabricator instance.

[clang][NFC] Remove IgnoreLinkageSpecDecls
ClosedPublic

Authored by urnathan on Feb 14 2022, 11:08 AM.

Details

Summary

The Itanium manglerThe Itanium mangler uses IgnoreLinkageSpecDecls to strip linkage spec contexts. It doesn't do this consistently, but there is no need for it to do it at all. getEffectiveDeclContext never returns a linkage spec, as it either recurses, uses getRedeclContext (which itself removes the specs), or gets the decl context of non-namespace entities.

This patch removes the function and all calls to it. For safety I add a couple of asserts to make sure we never get them.

(I also built a compiler which asserted the existing calls to IgnoreLinkageSpecDecls never saw a linkage spec.)

Diff Detail

Event Timeline

urnathan requested review of this revision.Feb 14 2022, 11:08 AM
urnathan created this revision.
This revision is now accepted and ready to land.Feb 14 2022, 6:04 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 15 2022, 4:29 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript