Merge pull request #84574 from madsodgaard/android-availability

This commit is contained in:
Mads Odgaard
2025-10-20 03:40:37 +02:00
committed by GitHub
parent 4403625279
commit c92e5b47f3
19 changed files with 189 additions and 5 deletions

View File

@@ -307,11 +307,18 @@ llvm::Value *
IRGenFunction::emitTargetOSVersionAtLeastCall(llvm::Value *major,
llvm::Value *minor,
llvm::Value *patch) {
auto fn = IGM.getPlatformVersionAtLeastFunctionPointer();
// compiler-rt in the NDK does not include __isPlatformVersionAtLeast
// but only __isOSVersionAtLeast
if (IGM.Triple.isAndroid()) {
auto fn = IGM.getOSVersionAtLeastFunctionPointer();
return Builder.CreateCall(fn, {major, minor, patch});
} else {
auto fn = IGM.getPlatformVersionAtLeastFunctionPointer();
llvm::Value *platformID =
llvm::ConstantInt::get(IGM.Int32Ty, getBaseMachOPlatformID(IGM.Triple));
return Builder.CreateCall(fn, {platformID, major, minor, patch});
llvm::Value *platformID =
llvm::ConstantInt::get(IGM.Int32Ty, getBaseMachOPlatformID(IGM.Triple));
return Builder.CreateCall(fn, {platformID, major, minor, patch});
}
}
llvm::Value *