diff options
author | Tom Stellard <[email protected]> | 2013-04-04 09:57:13 -0700 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2013-04-15 10:13:10 -0700 |
commit | 7782d19cdccfd8cefebec7e665aff27463b00ec1 (patch) | |
tree | 86bf11d519e1aa71cd71e787f83725b2d4815e48 /src/gallium/drivers/radeon | |
parent | 1d6eb23f2dc1bb53636802cb698e6788ca0a26ac (diff) |
radeon/llvm: Use a struct for storing compiled code
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/radeon_llvm_emit.cpp | 12 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/radeon_llvm_emit.h | 11 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp index a23532bee5f..9c5fd78f1e1 100644 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp @@ -96,9 +96,8 @@ radeon_llvm_shader_type(LLVMValueRef F, unsigned type) * caller's responsibility to free it. */ extern "C" unsigned -radeon_llvm_compile(LLVMModuleRef M, unsigned char ** bytes, - unsigned * byte_count, const char * gpu_family, - unsigned dump) { +radeon_llvm_compile(LLVMModuleRef M, struct radeon_llvm_binary *binary, + const char * gpu_family, unsigned dump) { Triple AMDGPUTriple(sys::getDefaultTargetTriple()); @@ -155,9 +154,10 @@ radeon_llvm_compile(LLVMModuleRef M, unsigned char ** bytes, out.flush(); std::string &data = oStream.str(); - *bytes = (unsigned char*)malloc(data.length() * sizeof(unsigned char)); - memcpy(*bytes, data.c_str(), data.length() * sizeof(unsigned char)); - *byte_count = data.length(); + + binary->code = (unsigned char*)malloc(data.length() * sizeof(unsigned char)); + memcpy(binary->code, data.c_str(), data.length() * sizeof(unsigned char)); + binary->code_size = data.length(); return 0; } diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.h b/src/gallium/drivers/radeon/radeon_llvm_emit.h index b68100f372f..f78fc19faf7 100644 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.h +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.h @@ -29,6 +29,14 @@ #include <llvm-c/Core.h> +struct radeon_llvm_binary { + unsigned char *code; + unsigned code_size; + unsigned char *config; + unsigned config_size; +}; + + #ifdef __cplusplus extern "C" { #endif @@ -42,8 +50,7 @@ unsigned radeon_llvm_bitcode_compile( unsigned radeon_llvm_compile( LLVMModuleRef M, - unsigned char ** bytes, - unsigned * byte_count, + struct radeon_llvm_binary *binary, const char * gpu_family, unsigned dump); |