Skip to content

Commit

Permalink
setTargetTriple now accepts Triple rather than string
Browse files Browse the repository at this point in the history
  • Loading branch information
ZequanWu committed Mar 7, 2025
1 parent b74da96 commit 4e4bed8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4e4bed8

Please sign in to comment.