[Mesa-dev] [PATCH 3/7] radeon/llvm: Implement radeon_llvm_get_num_kernels() using the C API

Tom Stellard tom at stellard.net
Thu Mar 7 13:51:10 PST 2013


From: Tom Stellard <thomas.stellard at amd.com>

---
 src/gallium/drivers/radeon/radeon_llvm_util.cpp |    7 +------
 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,
-- 
1.7.8.6



More information about the mesa-dev mailing list