[Mesa-dev] [PATCH 04/10] gallivm: inline gallivm_init_llvm_targets

Marek Olšák maraeo at gmail.com
Sat Jul 8 00:42:13 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

there is only one user.
---
 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 23 ++++++++---------------
 src/gallium/auxiliary/gallivm/lp_bld_misc.h   |  3 ---
 2 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 0e4a531..342cb38 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -117,47 +117,40 @@ static void init_native_targets()
 {
    // If we have a native target, initialize it to ensure it is linked in and
    // usable by the JIT.
    llvm::InitializeNativeTarget();
 
    llvm::InitializeNativeTargetAsmPrinter();
 
    llvm::InitializeNativeTargetDisassembler();
 }
 
-/**
- * The llvm target registry is not thread-safe, so drivers and state-trackers
- * that want to initialize targets should use the gallivm_init_llvm_targets()
- * function to safely initialize targets.
- *
- * LLVM targets should be initialized before the driver or state-tracker tries
- * to access the registry.
- */
-extern "C" void
-gallivm_init_llvm_targets(void)
-{
-   call_once(&init_native_targets_once_flag, init_native_targets);
-}
-
 extern "C" void
 lp_set_target_options(void)
 {
 #if HAVE_LLVM < 0x0304
    /*
     * By default LLVM adds a signal handler to output a pretty stack trace.
     * This signal handler is never removed, causing problems when unloading the
     * shared object where the gallium driver resides.
     */
    llvm::DisablePrettyStackTrace = true;
 #endif
 
-   gallivm_init_llvm_targets();
+   /* The llvm target registry is not thread-safe, so drivers and state-trackers
+    * that want to initialize targets should use the lp_set_target_options()
+    * function to safely initialize targets.
+    *
+    * LLVM targets should be initialized before the driver or state-tracker tries
+    * to access the registry.
+    */
+   call_once(&init_native_targets_once_flag, init_native_targets);
 }
 
 extern "C"
 LLVMTargetLibraryInfoRef
 gallivm_create_target_library_info(const char *triple)
 {
    return reinterpret_cast<LLVMTargetLibraryInfoRef>(
 #if HAVE_LLVM < 0x0307
    new llvm::TargetLibraryInfo(
 #else
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.h b/src/gallium/auxiliary/gallivm/lp_bld_misc.h
index dafb4cf..1b725d1 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.h
@@ -35,23 +35,20 @@
 #include <llvm-c/Target.h>
 
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 
 struct lp_generated_code;
 
-extern void
-gallivm_init_llvm_targets(void);
-
 extern LLVMTargetLibraryInfoRef
 gallivm_create_target_library_info(const char *triple);
 
 extern void
 gallivm_dispose_target_library_info(LLVMTargetLibraryInfoRef library_info);
 
 extern void
 lp_set_target_options(void);
 
 
-- 
2.7.4



More information about the mesa-dev mailing list