summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-03-07 16:51:10 -0500
committerTom Stellard <thomas.stellard@amd.com>2013-03-13 16:01:31 +0000
commitb34b8576ecde91c4d1898e7b9cd35f87b4ec2aa5 (patch)
tree4b8197e936df0d5c4c6ec9c2328e708d8c8ddbfb
parent7e9abbea15bf6ff717c1908870d9c2de219d69b4 (diff)
downloadexternal_mesa3d-b34b8576ecde91c4d1898e7b9cd35f87b4ec2aa5.zip
external_mesa3d-b34b8576ecde91c4d1898e7b9cd35f87b4ec2aa5.tar.gz
external_mesa3d-b34b8576ecde91c4d1898e7b9cd35f87b4ec2aa5.tar.bz2
radeon/llvm: Implement radeon_llvm_get_num_kernels() using the C API
-rw-r--r--src/gallium/drivers/radeon/radeon_llvm_util.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeon/radeon_llvm_util.cpp b/src/gallium/drivers/radeon/radeon_llvm_util.cpp
index 5f63ed7..fcfb6d8 100644
--- a/src/gallium/drivers/radeon/radeon_llvm_util.cpp
+++ b/src/gallium/drivers/radeon/radeon_llvm_util.cpp
@@ -43,12 +43,7 @@ extern "C" unsigned radeon_llvm_get_num_kernels(const unsigned char *bitcode,
unsigned bitcode_len)
{
LLVMModuleRef mod = radeon_llvm_parse_bitcode(bitcode, bitcode_len);
- llvm::Module *M = llvm::unwrap(mod);
- const llvm::NamedMDNode *kernel_node
- = M->getNamedMetadata("opencl.kernels");
- unsigned kernel_count = kernel_node->getNumOperands();
- delete M;
- return kernel_count;
+ return LLVMGetNamedMetadataNumOperands(mod, "opencl.kernels");
}
extern "C" LLVMModuleRef radeon_llvm_get_kernel_module(unsigned index,