Comment 4 for bug 987905

Revision history for this message
Pekka Jääskeläinen (pekka-jaaskelainen) wrote :

The -cl-kernel-arg-info seems to be implemented in Clang SVN (3.2). That is the official switch used to store and fetch the argument info which allows implementing clGetKernelArgInfo and allows generating a launcher that adheres to the target's ABI.

llvm/tools/clang$ cat test/CodeGenOpenCL/kernel-arg-info.cl
// RUN: %clang_cc1 %s -cl-kernel-arg-info -emit-llvm -o - | FileCheck %s

kernel void foo(int *X, int Y, int anotherArg) {
  *X = Y + anotherArg;
}

// CHECK: metadata !{metadata !"kernel_arg_name", metadata !"X", metadata !"Y", metadata !"anotherArg"}