diff options
Diffstat (limited to 'src/amd/common/ac_llvm_helper.cpp')
-rw-r--r-- | src/amd/common/ac_llvm_helper.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_helper.cpp b/src/amd/common/ac_llvm_helper.cpp index 1a2aee3bc9a..495bd98da9c 100644 --- a/src/amd/common/ac_llvm_helper.cpp +++ b/src/amd/common/ac_llvm_helper.cpp @@ -61,6 +61,16 @@ bool ac_llvm_is_function(LLVMValueRef v) return LLVMGetValueKind(v) == LLVMFunctionValueKind; } +LLVMModuleRef ac_create_module(LLVMTargetMachineRef tm, LLVMContextRef ctx) +{ + llvm::TargetMachine *TM = reinterpret_cast<llvm::TargetMachine*>(tm); + LLVMModuleRef module = LLVMModuleCreateWithNameInContext("mesa-shader", ctx); + + llvm::unwrap(module)->setTargetTriple(TM->getTargetTriple().getTriple()); + llvm::unwrap(module)->setDataLayout(TM->createDataLayout()); + return module; +} + LLVMBuilderRef ac_create_builder(LLVMContextRef ctx, enum ac_float_mode float_mode) { |