This leads to crashes when multiple threads try to compile compute
shaders in the same time.
Fixes a crash in bfgminer when using more than one thread.
unsigned bitcode_len)
{
LLVMMemoryBufferRef buf;
- LLVMModuleRef module = LLVMModuleCreateWithName("radeon");
+ LLVMContextRef ctx = LLVMContextCreate();
+ LLVMModuleRef module;
buf = LLVMCreateMemoryBufferWithMemoryRangeCopy((const char*)bitcode,
bitcode_len, "radeon");
- LLVMParseBitcode(buf, &module, NULL);
+ LLVMParseBitcodeInContext(ctx, buf, &module, NULL);
return module;
}