[Beignet] [PATCH] remove the LinkOnceAnyLinkage since the libocl is introduced.

xionghu.luo at intel.com xionghu.luo at intel.com
Mon Sep 15 18:40:09 PDT 2014


From: Luo Xionghu <xionghu.luo at intel.com>

no need to set the LinkOnceAnyLinkage for global variables and functions
to avoid redefinition.

Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
---
 backend/src/backend/gen_program.cpp |    9 ---------
 1 file changed, 9 deletions(-)

diff --git a/backend/src/backend/gen_program.cpp b/backend/src/backend/gen_program.cpp
index 44c9c10..bd0c070 100644
--- a/backend/src/backend/gen_program.cpp
+++ b/backend/src/backend/gen_program.cpp
@@ -367,15 +367,6 @@ namespace gbe {
     }else{
       //set the global variables and functions to link once to fix redefine.
       llvm::Module* src = (llvm::Module*)((GenProgram*)src_program)->module;
-      for (llvm::Module::global_iterator I = src->global_begin(), E = src->global_end(); I != E; ++I) {
-        I->setLinkage(llvm::GlobalValue::LinkOnceAnyLinkage);
-      }
-
-      for (llvm::Module::iterator I = src->begin(), E = src->end(); I != E; ++I) {
-        llvm::Function *F = llvm::dyn_cast<llvm::Function>(I);
-        if (F && isKernelFunction(*F)) continue;
-        I->setLinkage(llvm::GlobalValue::LinkOnceAnyLinkage);
-      }
       llvm::Module* dst = (llvm::Module*)((GenProgram*)dst_program)->module;
       llvm::Linker::LinkModules( dst,
                                  src,
-- 
1.7.9.5



More information about the Beignet mailing list