@@ -118,6 +118,7 @@ swift::basePlatformForExtensionPlatform(PlatformKind Platform) {
118118 case PlatformKind::FreeBSD:
119119 case PlatformKind::OpenBSD:
120120 case PlatformKind::Windows:
121+ case PlatformKind::Android:
121122 case PlatformKind::none:
122123 return std::nullopt ;
123124 }
@@ -164,6 +165,8 @@ static bool isPlatformActiveForTarget(PlatformKind Platform,
164165 return Target.isOSFreeBSD ();
165166 case PlatformKind::Windows:
166167 return Target.isOSWindows ();
168+ case PlatformKind::Android:
169+ return Target.isAndroid ();
167170 case PlatformKind::none:
168171 llvm_unreachable (" handled above" );
169172 }
@@ -219,6 +222,10 @@ static PlatformKind platformForTriple(const llvm::Triple &triple,
219222 : PlatformKind::visionOS);
220223 }
221224
225+ if (triple.isAndroid ()) {
226+ return PlatformKind::Android;
227+ }
228+
222229 return PlatformKind::none;
223230}
224231
@@ -291,6 +298,8 @@ swift::tripleOSTypeForPlatform(PlatformKind platform) {
291298 return llvm::Triple::OpenBSD;
292299 case PlatformKind::Windows:
293300 return llvm::Triple::Win32;
301+ case PlatformKind::Android:
302+ return llvm::Triple::Linux;
294303 case PlatformKind::none:
295304 return std::nullopt ;
296305 }
@@ -326,6 +335,7 @@ bool swift::isPlatformSPI(PlatformKind Platform) {
326335 case PlatformKind::OpenBSD:
327336 case PlatformKind::FreeBSD:
328337 case PlatformKind::Windows:
338+ case PlatformKind::Android:
329339 case PlatformKind::none:
330340 return false ;
331341 }
0 commit comments