Include only the targeted kernel in the binary.
Previously it included also the other kernel even though they
were not being compiled. It was then left in an internal
function which might be never called.
@@ -83,7 +83,7 @@ Flatten::runOnModule(Module &M)
llvm::Function *f = &*i;
if (f->isDeclaration() ||
AuxFuncs.find(f->getName().str()) != AuxFuncs.end()) continue;
- if (KernelName == f->getName() ||
+ if (KernelName == f->getName() &&
pocl::Workgroup::isKernelToProcess(*f)) {
#if LLVM_OLDER_THAN_5_0
AttributeSet Attrs;
