@@ -18,25 +18,37 @@ using namespace swift;
18
18
bool swift::tripleIsiOSSimulator (const llvm::Triple &triple) {
19
19
llvm::Triple::ArchType arch = triple.getArch ();
20
20
return (triple.isiOS () &&
21
- (arch == llvm::Triple::x86 || arch == llvm::Triple::x86_64));
21
+ // FIXME: transitional, this should eventually stop testing arch, and
22
+ // switch to only checking the -environment field.
23
+ (triple.isSimulatorEnvironment () ||
24
+ arch == llvm::Triple::x86 || arch == llvm::Triple::x86_64));
22
25
}
23
26
24
27
bool swift::tripleIsAppleTVSimulator (const llvm::Triple &triple) {
25
28
llvm::Triple::ArchType arch = triple.getArch ();
26
29
return (triple.isTvOS () &&
27
- (arch == llvm::Triple::x86 || arch == llvm::Triple::x86_64));
30
+ // FIXME: transitional, this should eventually stop testing arch, and
31
+ // switch to only checking the -environment field.
32
+ (triple.isSimulatorEnvironment () ||
33
+ arch == llvm::Triple::x86 || arch == llvm::Triple::x86_64));
28
34
}
29
35
30
36
bool swift::tripleIsWatchSimulator (const llvm::Triple &triple) {
31
37
llvm::Triple::ArchType arch = triple.getArch ();
32
38
return (triple.isWatchOS () &&
33
- (arch == llvm::Triple::x86 || arch == llvm::Triple::x86_64));
39
+ // FIXME: transitional, this should eventually stop testing arch, and
40
+ // switch to only checking the -environment field.
41
+ (triple.isSimulatorEnvironment () ||
42
+ arch == llvm::Triple::x86 || arch == llvm::Triple::x86_64));
34
43
}
35
44
36
45
bool swift::tripleIsAnySimulator (const llvm::Triple &triple) {
37
- return tripleIsiOSSimulator (triple) ||
38
- tripleIsWatchSimulator (triple) ||
39
- tripleIsAppleTVSimulator (triple);
46
+ // FIXME: transitional, this should eventually just use the -environment
47
+ // field.
48
+ return triple.isSimulatorEnvironment () ||
49
+ tripleIsiOSSimulator (triple) ||
50
+ tripleIsWatchSimulator (triple) ||
51
+ tripleIsAppleTVSimulator (triple);
40
52
}
41
53
42
54
DarwinPlatformKind swift::getDarwinPlatformKind (const llvm::Triple &triple) {
0 commit comments