Skip to content

Commit

Permalink
version guard
Browse files Browse the repository at this point in the history
  • Loading branch information
HertzDevil committed Dec 11, 2023
1 parent a1303c2 commit 371a838
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/llvm/ext/llvm_ext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ LLVMValueRef LLVMExtBuildInvoke2(
Bundles, Name));
}

#if !LLVM_VERSION_GE(18, 0)
static TargetMachine *unwrap(LLVMTargetMachineRef P) {
return reinterpret_cast<TargetMachine *>(P);
}

void LLVMExtSetTargetMachineGlobalISel(LLVMTargetMachineRef T, LLVMBool Enable) {
unwrap(T)->setGlobalISel(Enable);
}
#endif

} // extern "C"

0 comments on commit 371a838

Please sign in to comment.