summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>2014-12-04 05:30:58 +0000
committerSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>2014-12-04 05:30:58 +0000
commitc6093fea0350cdaa9f4f24f9b36d976bd93e8c15 (patch)
tree0b166b9b30ddef7ae97b5c635565ef92a0196392 /clang/lib/CodeGen/CodeGenFunction.cpp
parent5bf9578ce4d6ab896faf9a122955ff3523cc19b5 (diff)
downloadbcm5719-llvm-c6093fea0350cdaa9f4f24f9b36d976bd93e8c15.tar.gz
bcm5719-llvm-c6093fea0350cdaa9f4f24f9b36d976bd93e8c15.zip
Always emit kernel arg info for SPIR.
http://llvm.org/bugs/show_bug.cgi?id=21555 Currently, kernel argument metadata is omitted unless the "-cl-kernel-arg-info" option is specified. But the SPIR 1.2 spec requires that all metadata except kernel_arg_name should always be emitted, and kernel_arg_name is only emitted when "-cl-kernel-arg-info" is specified. Patch ported by Ryan Burn from the Khronos SPIR generator. https://github.com/KhronosGroup/SPIR llvm-svn: 223340
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 4291b148930..02cca4bf21d 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -483,7 +483,8 @@ static void GenOpenCLArgMetadata(const FunctionDecl *FD, llvm::Function *Fn,
kernelMDArgs.push_back(llvm::MDNode::get(Context, argTypeNames));
kernelMDArgs.push_back(llvm::MDNode::get(Context, argBaseTypeNames));
kernelMDArgs.push_back(llvm::MDNode::get(Context, argTypeQuals));
- kernelMDArgs.push_back(llvm::MDNode::get(Context, argNames));
+ if (CGM.getCodeGenOpts().EmitOpenCLArgMetadata)
+ kernelMDArgs.push_back(llvm::MDNode::get(Context, argNames));
}
void CodeGenFunction::EmitOpenCLKernelMetadata(const FunctionDecl *FD,
@@ -497,9 +498,8 @@ void CodeGenFunction::EmitOpenCLKernelMetadata(const FunctionDecl *FD,
SmallVector <llvm::Value*, 5> kernelMDArgs;
kernelMDArgs.push_back(Fn);
- if (CGM.getCodeGenOpts().EmitOpenCLArgMetadata)
- GenOpenCLArgMetadata(FD, Fn, CGM, Context, kernelMDArgs,
- Builder, getContext());
+ GenOpenCLArgMetadata(FD, Fn, CGM, Context, kernelMDArgs, Builder,
+ getContext());
if (const VecTypeHintAttr *A = FD->getAttr<VecTypeHintAttr>()) {
QualType hintQTy = A->getTypeHint();
OpenPOWER on IntegriCloud