RADEON_LLVM_SHADER_CS = 3,
};
+void radeon_llvm_add_attribute(LLVMValueRef F, const char *name, int value)
+{
+ char str[16];
+
+ snprintf(str, sizeof(str), "%i", value);
+ LLVMAddTargetDependentFunctionAttr(F, name, str);
+}
+
/**
* Set the shader type we want to compile
*
*/
void radeon_llvm_shader_type(LLVMValueRef F, unsigned type)
{
- char Str[2];
enum radeon_llvm_shader_type llvm_type;
switch (type) {
assert(0);
}
- sprintf(Str, "%1d", llvm_type);
-
- LLVMAddTargetDependentFunctionAttr(F, "ShaderType", Str);
+ radeon_llvm_add_attribute(F, "ShaderType", llvm_type);
}
static void init_r600_target()
struct pipe_debug_callback;
struct radeon_shader_binary;
+void radeon_llvm_add_attribute(LLVMValueRef F, const char *name, int value);
void radeon_llvm_shader_type(LLVMValueRef F, unsigned type);
LLVMTargetRef radeon_llvm_get_r600_target(const char *triple);