From b34b8576ecde91c4d1898e7b9cd35f87b4ec2aa5 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 7 Mar 2013 16:51:10 -0500 Subject: radeon/llvm: Implement radeon_llvm_get_num_kernels() using the C API --- src/gallium/drivers/radeon/radeon_llvm_util.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') 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, -- cgit v1.2.3