1
Fork 0

setTargetTriple now accepts Triple rather than string

This commit is contained in:
Zequan Wu 2025-03-06 16:24:40 -08:00
parent b74da9613a
commit 4e4bed8684

View file

@ -153,7 +153,11 @@ extern "C" LLVMContextRef LLVMRustContextCreate(bool shouldDiscardNames) {
extern "C" void LLVMRustSetNormalizedTarget(LLVMModuleRef M,
const char *Triple) {
#if LLVM_VERSION_GE(21, 0)
unwrap(M)->setTargetTriple(llvm::Triple(Triple::normalize(Triple)));
#else
unwrap(M)->setTargetTriple(Triple::normalize(Triple));
#endif
}
extern "C" void LLVMRustPrintPassTimings(RustStringRef OutBuf) {