diff options
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionImport.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/FunctionImport.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp index 71a76a6a67c..9207f5fe0ef 100644 --- a/llvm/lib/Transforms/IPO/FunctionImport.cpp +++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp @@ -1053,9 +1053,10 @@ static Function *replaceAliasWithAliasee(Module *SrcModule, GlobalAlias *GA) { ValueToValueMapTy VMap; Function *NewFn = CloneFunction(Fn, VMap); - // Clone should use the original alias's linkage and name, and we ensure - // all uses of alias instead use the new clone (casted if necessary). + // Clone should use the original alias's linkage, visibility and name, and we + // ensure all uses of alias instead use the new clone (casted if necessary). NewFn->setLinkage(GA->getLinkage()); + NewFn->setVisibility(GA->getVisibility()); GA->replaceAllUsesWith(ConstantExpr::getBitCast(NewFn, GA->getType())); NewFn->takeName(GA); return NewFn; |