Skip to content

Commit 4e4bed8

Browse files
committed
setTargetTriple now accepts Triple rather than string
1 parent b74da96 commit 4e4bed8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,11 @@ extern "C" LLVMContextRef LLVMRustContextCreate(bool shouldDiscardNames) {
153153

154154
extern "C" void LLVMRustSetNormalizedTarget(LLVMModuleRef M,
155155
const char *Triple) {
156+
#if LLVM_VERSION_GE(21, 0)
157+
unwrap(M)->setTargetTriple(llvm::Triple(Triple::normalize(Triple)));
158+
#else
156159
unwrap(M)->setTargetTriple(Triple::normalize(Triple));
160+
#endif
157161
}
158162

159163
extern "C" void LLVMRustPrintPassTimings(RustStringRef OutBuf) {

0 commit comments

Comments
 (0)