Rollup merge of #138137 - ZequanWu:fix-triple, r=cuviper

setTargetTriple now accepts Triple rather than string

https://github.com/llvm/llvm-project/pull/129868 updated `setTargetTriple`
This commit is contained in:
Jacob Pratt
2025-03-07 21:57:52 -05:00
committed by GitHub
@@ -152,8 +152,12 @@ extern "C" LLVMContextRef LLVMRustContextCreate(bool shouldDiscardNames) {
}
extern "C" void LLVMRustSetNormalizedTarget(LLVMModuleRef M,
const char *Triple) {
unwrap(M)->setTargetTriple(Triple::normalize(Triple));
const char *Target) {
#if LLVM_VERSION_GE(21, 0)
unwrap(M)->setTargetTriple(Triple(Triple::normalize(Target)));
#else
unwrap(M)->setTargetTriple(Triple::normalize(Target));
#endif
}
extern "C" void LLVMRustPrintPassTimings(RustStringRef OutBuf) {