diff options
author | Dave Airlie <[email protected]> | 2018-06-27 08:36:41 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2018-07-04 05:15:23 +1000 |
commit | 473be16c745d0d78a0be71828d05aeb5d8a7cb76 (patch) | |
tree | f0bc4bf306d48c9f6bfbb10f89563c3a8d29aed1 /src/amd/common/ac_llvm_util.c | |
parent | 590cc7c8f67902423d812ab219afec93031c6252 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/amd/common/ac_llvm_util.c')
-rw-r--r-- | src/amd/common/ac_llvm_util.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/amd/common/ac_llvm_util.c b/src/amd/common/ac_llvm_util.c index 99cc677edce..25ff4a8c22a 100644 --- a/src/amd/common/ac_llvm_util.c +++ b/src/amd/common/ac_llvm_util.c @@ -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) { |