This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Filter out available_externally aliases
ClosedPublic

Authored by Hahnfeld on Jan 23 2023, 5:41 AM.

Details

Summary

The Language Reference says that aliases can have available_externally linkage if their aliasee is an available_externally global value. Using this kind of aliases resulted in crashes during code generation, filter them out (the same that the AsmPrinter also filters out GlobalVariables in emitSpecialLLVMGlobal(); Functions are discarded in the machine pass infrastructure).

Diff Detail

Event Timeline

Hahnfeld created this revision.Jan 23 2023, 5:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2023, 5:41 AM
Hahnfeld requested review of this revision.Jan 23 2023, 5:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2023, 5:41 AM
Hahnfeld updated this revision to Diff 491330.Jan 23 2023, 5:46 AM

Fix type of function alias.

gchatelet resigned from this revision.Jan 23 2023, 6:27 AM

I've only touched this file for refactoring purposes, I'm not qualified to do a proper review.

lhames accepted this revision.Jan 24 2023, 5:07 PM
lhames added a subscriber: lhames.

This looks right to me -- the verifier already requires available_externally aliases to point to other available_externally symbols, so if we're skipping an alias here then we know that we'll also skip all the things that it points to.

This revision is now accepted and ready to land.Jan 24 2023, 5:07 PM
This revision was landed with ongoing or failed builds.Feb 1 2023, 12:41 AM
This revision was automatically updated to reflect the committed changes.