This does not solve all of the problems with using LLVM in a
multithreaded enivronment, but it should help in some cases.
Reviewed-by: Mathias.Froehlich@web.de
#include "lp_bld_misc.h"
+namespace {
+
+class LLVMEnsureMultithreaded {
+public:
+ LLVMEnsureMultithreaded()
+ {
+ if (!LLVMIsMultithreaded()) {
+ LLVMStartMultithreaded();
+ }
+ }
+};
+
+static LLVMEnsureMultithreaded lLVMEnsureMultithreaded;
+
+}
extern "C" void
lp_set_target_options(void)
using namespace llvm;
-namespace {
-
-class LLVMEnsureMultithreaded {
-public:
- LLVMEnsureMultithreaded()
- {
- llvm_start_multithreaded();
- }
-};
-
-static LLVMEnsureMultithreaded lLVMEnsureMultithreaded;
-
-}
-
/**
* Set the shader type we want to compile
*