From 2f50744fe723b48389ed1f30e8f3e73217a66f9e Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 2 Apr 2015 05:28:10 +0000 Subject: [Orc] Fix local-linkage handling in the CompileOnDemand layer. llvm-svn: 233895 --- llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/ExecutionEngine/Orc') diff --git a/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp index 8cf490f34cb..74766450e8c 100644 --- a/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp +++ b/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp @@ -54,7 +54,7 @@ void partition(Module &M, const ModulePartitionMap &PMap) { if (KVPair.second.count(&Orig)) { copyGVInitializer(New, Orig, VMap); } - if (New.getLinkage() == GlobalValue::PrivateLinkage) { + if (New.hasLocalLinkage()) { New.setLinkage(GlobalValue::ExternalLinkage); New.setVisibility(GlobalValue::HiddenVisibility); } @@ -64,7 +64,7 @@ void partition(Module &M, const ModulePartitionMap &PMap) { [&](Function &New, const Function &Orig, ValueToValueMapTy &VMap) { if (KVPair.second.count(&Orig)) copyFunctionBody(New, Orig, VMap); - if (New.getLinkage() == GlobalValue::InternalLinkage) { + if (New.hasLocalLinkage()) { New.setLinkage(GlobalValue::ExternalLinkage); New.setVisibility(GlobalValue::HiddenVisibility); } -- cgit v1.2.3