OSDN Git Service

[ThinLTO] Don't try to import alias unless aliasee can be imported
authorTeresa Johnson <tejohnson@google.com>
Sun, 27 Mar 2016 15:01:11 +0000 (15:01 +0000)
committerTeresa Johnson <tejohnson@google.com>
Sun, 27 Mar 2016 15:01:11 +0000 (15:01 +0000)
commit2a771565ac19780db2ed865beda6ddf0afb5015a
tree4a0de0152be7632752277ee78e6ef7cbb107e850
parent68e74bdd60724486f7045e64519c05e0c236da5f
[ThinLTO] Don't try to import alias unless aliasee can be imported

With r264503, aliases are now being added to the GlobalsToImport set
even when their aliasees can't be imported due to their linkage type.
While the importing worked correctly (the aliases imported as
declarations) due to the logic in doImportAsDefinition, there is no
point to adding them to the GlobalsToImport set.

Additionally, with D18487 it was resulting in incorrectly printing a
message indicating that the alias was imported.

To avoid this, delay adding aliases to the GlobalsToImport set until
after the linkage type of the aliasee is checked.

This patch is part of D18487.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264536 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/FunctionImport.cpp