[CodeGen] Filter out available_externally aliases
authorJonas Hahnfeld <jonas.hahnfeld@cern.ch>
Mon, 23 Jan 2023 13:09:48 +0000 (14:09 +0100)
committerJonas Hahnfeld <jonas.hahnfeld@cern.ch>
Wed, 1 Feb 2023 08:40:30 +0000 (09:40 +0100)
commitf1c4f927f7c15b5efdc3589c050fd0513bf6b303
tree65bf5aa48150b3a8486ea31dce53bbf027f90d92
parente53f41c39f3eb5052965c720d2cb517d2945fd12
[CodeGen] Filter out available_externally aliases

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).

Differential Revision: https://reviews.llvm.org/D142352
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/test/CodeGen/Generic/available_externally_alias.ll [new file with mode: 0644]