ac/radv: split the non-common init_once code from the common target code. (v2)
This just splits out the non-shared code and reuses ac_get_llvm_target in radv. v2: rebase on Marek's patch - fixup brace position/whitespace Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
@@ -57,13 +57,16 @@ static void ac_init_llvm_target()
|
||||
|
||||
static once_flag ac_init_llvm_target_once_flag = ONCE_FLAG_INIT;
|
||||
|
||||
void ac_init_llvm_once(void)
|
||||
{
|
||||
call_once(&ac_init_llvm_target_once_flag, ac_init_llvm_target);
|
||||
}
|
||||
|
||||
LLVMTargetRef ac_get_llvm_target(const char *triple)
|
||||
{
|
||||
LLVMTargetRef target = NULL;
|
||||
char *err_message = NULL;
|
||||
|
||||
call_once(&ac_init_llvm_target_once_flag, ac_init_llvm_target);
|
||||
|
||||
if (LLVMGetTargetFromTriple(triple, &target, &err_message)) {
|
||||
fprintf(stderr, "Cannot find target for triple %s ", triple);
|
||||
if (err_message) {
|
||||
|
Reference in New Issue
Block a user