================
@@ -480,12 +481,19 @@ static void thinLTOInternalizeAndPromoteGUID(
VI.getSummaryList().size() == 1 &&
!GlobalValue::isLocalLinkage(VI.getSummaryList().front()->linkage());
+ bool NameInGlobals = false;
for (auto &S : VI.getSummaryList()) {
// First see if we need to promote an internal value because it is not
// exported.
if (isExported(S->modulePath(), VI)) {
- if (GlobalValue::isLocalLinkage(S->linkage()))
+ if (GlobalValue::isLocalLinkage(S->linkage())) {
S->setLinkage(GlobalValue::ExternalLinkage);
+ if (!NameInGlobals) {
+ if (Globals.insert(VI.name()).second)
+ S->setRenameOnPromotion(false);
+ NameInGlobals = true;
----------------
yonghong-song wrote:
I will put 'NamesInGlobals = true' before the 'if (Globals....)' condition.
This will make logic more easy to understand. BTW, will also rename Globals to
ExternallyVisibleSymbolNames.
https://github.com/llvm/llvm-project/pull/178587
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits