mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #84574 from madsodgaard/android-availability
This commit is contained in:
@@ -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 *
|
||||
|
||||
Reference in New Issue
Block a user