Skip to content

Commit 41a122a

Browse files
Niram7777Megamouse
authored andcommitted
[Build] Explicit Triple with LLVM 21.1.0
1 parent 1c0fa2a commit 41a122a

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

Utilities/JITLLVM.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,11 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
658658
std::string result;
659659

660660
auto null_mod = std::make_unique<llvm::Module> ("null_", *m_context);
661+
#if LLVM_VERSION_MAJOR >= 21 && (LLVM_VERSION_MINOR >= 1 || LLVM_VERSION_MAJOR >= 22)
662+
null_mod->setTargetTriple(llvm::Triple(jit_compiler::triple1()));
663+
#else
661664
null_mod->setTargetTriple(jit_compiler::triple1());
665+
#endif
662666

663667
std::unique_ptr<llvm::RTDyldMemoryManager> mem;
664668

@@ -672,7 +676,11 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
672676
else
673677
{
674678
mem = std::make_unique<MemoryManager2>(std::move(symbols_cement));
679+
#if LLVM_VERSION_MAJOR >= 21 && (LLVM_VERSION_MINOR >= 1 || LLVM_VERSION_MAJOR >= 22)
680+
null_mod->setTargetTriple(llvm::Triple(jit_compiler::triple2()));
681+
#else
675682
null_mod->setTargetTriple(jit_compiler::triple2());
683+
#endif
676684
}
677685
}
678686
else

rpcs3/Emu/Cell/PPUThread.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5803,7 +5803,11 @@ static void ppu_initialize2(jit_compiler& jit, const ppu_module<lv2_obj>& module
58035803
std::unique_ptr<Module> _module = std::make_unique<Module>(obj_name, jit.get_context());
58045804

58055805
// Initialize target
5806+
#if LLVM_VERSION_MAJOR >= 21 && (LLVM_VERSION_MINOR >= 1 || LLVM_VERSION_MAJOR >= 22)
5807+
_module->setTargetTriple(Triple(jit_compiler::triple1()));
5808+
#else
58065809
_module->setTargetTriple(jit_compiler::triple1());
5810+
#endif
58075811
_module->setDataLayout(jit.get_engine().getTargetMachine()->createDataLayout());
58085812

58095813
// Initialize translator

rpcs3/Emu/Cell/SPULLVMRecompiler.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,11 @@ class spu_llvm_recompiler : public spu_recompiler_base, public cpu_translator
15981598

15991599
// Create LLVM module
16001600
std::unique_ptr<Module> _module = std::make_unique<Module>(m_hash + ".obj", m_context);
1601+
#if LLVM_VERSION_MAJOR >= 21 && (LLVM_VERSION_MINOR >= 1 || LLVM_VERSION_MAJOR >= 22)
1602+
_module->setTargetTriple(Triple(jit_compiler::triple2()));
1603+
#else
16011604
_module->setTargetTriple(jit_compiler::triple2());
1605+
#endif
16021606
_module->setDataLayout(m_jit.get_engine().getTargetMachine()->createDataLayout());
16031607
m_module = _module.get();
16041608

@@ -2873,7 +2877,11 @@ class spu_llvm_recompiler : public spu_recompiler_base, public cpu_translator
28732877

28742878
// Create LLVM module
28752879
std::unique_ptr<Module> _module = std::make_unique<Module>("spu_interpreter.obj", m_context);
2880+
#if LLVM_VERSION_MAJOR >= 21 && (LLVM_VERSION_MINOR >= 1 || LLVM_VERSION_MAJOR >= 22)
2881+
_module->setTargetTriple(Triple(jit_compiler::triple2()));
2882+
#else
28762883
_module->setTargetTriple(jit_compiler::triple2());
2884+
#endif
28772885
_module->setDataLayout(m_jit.get_engine().getTargetMachine()->createDataLayout());
28782886
m_module = _module.get();
28792887

0 commit comments

Comments
 (0)