diff --git a/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp b/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp --- a/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp +++ b/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp @@ -159,6 +159,7 @@ Function::Create(EmptyFT, GlobalValue::ExternalLinkage, F.getAddressSpace(), "", &M); NewF->setVisibility(F.getVisibility()); + NewF->setUnnamedAddr(F.getUnnamedAddr()); NewF->takeName(&F); F.replaceAllUsesWith(ConstantExpr::getBitCast(NewF, F.getType())); F.eraseFromParent();