From: Tom Stellard Date: Thu, 7 Mar 2013 21:51:10 +0000 (-0500) Subject: radeon/llvm: Implement radeon_llvm_get_num_kernels() using the C API X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b34b8576ecde91c4d1898e7b9cd35f87b4ec2aa5;p=mesa.git radeon/llvm: Implement radeon_llvm_get_num_kernels() using the C API --- diff --git a/src/gallium/drivers/radeon/radeon_llvm_util.cpp b/src/gallium/drivers/radeon/radeon_llvm_util.cpp index 5f63ed7a9c6..fcfb6d8966d 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,