Skip to content

Commit 2a0aedf

Browse files
Switch from deprecated overload of createTargetMachine
The overload accepting the string version of a triple will be removed soon, so switch over to the one that accepts a triple object.
1 parent 3f4145e commit 2a0aedf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/iwasm/compilation/aot_llvm_extra2.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,13 @@ LLVMCreateTargetMachineWithOpts(LLVMTargetRef ctarget, const char *triple,
157157
auto ol = convert(opt_level);
158158
bool jit;
159159
auto cm = convert(code_model, &jit);
160+
#if LLVM_VERSION_MAJOR >= 21
161+
auto targetmachine = target->createTargetMachine(
162+
llvm::Triple(triple), cpu, features, opts, rm, cm, ol, jit);
163+
#else
160164
auto targetmachine = target->createTargetMachine(triple, cpu, features,
161165
opts, rm, cm, ol, jit);
166+
#endif
162167
#if LLVM_VERSION_MAJOR >= 18
163168
// always place data in normal data section.
164169
//

0 commit comments

Comments
 (0)