Explorar el Código

Switch from deprecated overload of createTargetMachine (#4650)

The overload accepting the string version of a triple will be removed
soon, so switch over to the one that accepts a triple object.

https://github.com/llvm/llvm-project/pull/161053
Aiden Grossman hace 3 meses
padre
commit
df908048de
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      core/iwasm/compilation/aot_llvm_extra2.cpp

+ 5 - 0
core/iwasm/compilation/aot_llvm_extra2.cpp

@@ -157,8 +157,13 @@ LLVMCreateTargetMachineWithOpts(LLVMTargetRef ctarget, const char *triple,
     auto ol = convert(opt_level);
     bool jit;
     auto cm = convert(code_model, &jit);
+#if LLVM_VERSION_MAJOR >= 21
+    auto targetmachine = target->createTargetMachine(
+        llvm::Triple(triple), cpu, features, opts, rm, cm, ol, jit);
+#else
     auto targetmachine = target->createTargetMachine(triple, cpu, features,
                                                      opts, rm, cm, ol, jit);
+#endif
 #if LLVM_VERSION_MAJOR >= 18
     // always place data in normal data section.
     //