[llvm] r233895 - [Orc] Fix local-linkage handling in the CompileOnDemand layer.
Lang Hames
lhames at gmail.com
Wed Apr 1 22:28:11 PDT 2015
Author: lhames
Date: Thu Apr 2 00:28:10 2015
New Revision: 233895
URL: http://llvm.org/viewvc/llvm-project?rev=233895&view=rev
Log:
[Orc] Fix local-linkage handling in the CompileOnDemand layer.
Added:
llvm/trunk/test/ExecutionEngine/OrcLazy/private_linkage.ll
Modified:
llvm/trunk/lib/ExecutionEngine/Orc/IndirectionUtils.cpp
Modified: llvm/trunk/lib/ExecutionEngine/Orc/IndirectionUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Orc/IndirectionUtils.cpp?rev=233895&r1=233894&r2=233895&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Orc/IndirectionUtils.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/Orc/IndirectionUtils.cpp Thu Apr 2 00:28:10 2015
@@ -54,7 +54,7 @@ void partition(Module &M, const ModulePa
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 ModulePa
[&](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);
}
Added: llvm/trunk/test/ExecutionEngine/OrcLazy/private_linkage.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/OrcLazy/private_linkage.ll?rev=233895&view=auto
==============================================================================
--- llvm/trunk/test/ExecutionEngine/OrcLazy/private_linkage.ll (added)
+++ llvm/trunk/test/ExecutionEngine/OrcLazy/private_linkage.ll Thu Apr 2 00:28:10 2015
@@ -0,0 +1,12 @@
+; RUN: lli -jit-kind=orc-lazy %s
+
+define private void @_ZL3foov() {
+entry:
+ ret void
+}
+
+define i32 @main(i32 %argc, i8** nocapture readnone %argv) {
+entry:
+ tail call void @_ZL3foov()
+ ret i32 0
+}
More information about the llvm-commits
mailing list