Skip to content

Commit 8af3cc9

Browse files
committed
[GlobalOpt] Don't replace aliasee with alias that has weak linkage
1 parent 2868e26 commit 8af3cc9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Transforms/IPO/GlobalOpt.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,6 +2224,9 @@ static bool mayHaveOtherReferences(GlobalValue &GV, const LLVMUsed &U) {
22242224

22252225
static bool hasUsesToReplace(GlobalAlias &GA, const LLVMUsed &U,
22262226
bool &RenameTarget) {
2227+
if (GA.isWeakForLinker())
2228+
return false;
2229+
22272230
RenameTarget = false;
22282231
bool Ret = false;
22292232
if (hasUseOtherThanLLVMUsed(GA, U))

0 commit comments

Comments
 (0)