Skip to content

Commit 3ef763a

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 3ef763a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/iwasm/compilation/aot_llvm_extra2.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,14 @@ 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(llvm::Triple(triple), cpu,
162+
features, opts, rm, cm, ol
163+
jit);
164+
#else
160165
auto targetmachine = target->createTargetMachine(triple, cpu, features,
161166
opts, rm, cm, ol, jit);
167+
#endif
162168
#if LLVM_VERSION_MAJOR >= 18
163169
// always place data in normal data section.
164170
//

0 commit comments

Comments
 (0)