@@ -39,6 +39,7 @@ static const StringRef SupportedConditionalCompilationOSs[] = {
39
39
" PS4" ,
40
40
" Cygwin" ,
41
41
" Haiku" ,
42
+ " WASI" ,
42
43
};
43
44
44
45
static const StringRef SupportedConditionalCompilationArches[] = {
@@ -48,7 +49,8 @@ static const StringRef SupportedConditionalCompilationArches[] = {
48
49
" x86_64" ,
49
50
" powerpc64" ,
50
51
" powerpc64le" ,
51
- " s390x"
52
+ " s390x" ,
53
+ " wasm32" ,
52
54
};
53
55
54
56
static const StringRef SupportedConditionalCompilationEndianness[] = {
@@ -246,6 +248,9 @@ std::pair<bool, bool> LangOptions::setTarget(llvm::Triple triple) {
246
248
case llvm::Triple::Haiku:
247
249
addPlatformConditionValue (PlatformConditionKind::OS, " Haiku" );
248
250
break ;
251
+ case llvm::Triple::WASI:
252
+ addPlatformConditionValue (PlatformConditionKind::OS, " WASI" );
253
+ break ;
249
254
default :
250
255
UnsupportedOS = true ;
251
256
break ;
@@ -277,6 +282,9 @@ std::pair<bool, bool> LangOptions::setTarget(llvm::Triple triple) {
277
282
case llvm::Triple::ArchType::systemz:
278
283
addPlatformConditionValue (PlatformConditionKind::Arch, " s390x" );
279
284
break ;
285
+ case llvm::Triple::ArchType::wasm32:
286
+ addPlatformConditionValue (PlatformConditionKind::Arch, " wasm32" );
287
+ break ;
280
288
default :
281
289
UnsupportedArch = true ;
282
290
}
@@ -291,6 +299,7 @@ std::pair<bool, bool> LangOptions::setTarget(llvm::Triple triple) {
291
299
case llvm::Triple::ArchType::thumb:
292
300
case llvm::Triple::ArchType::aarch64:
293
301
case llvm::Triple::ArchType::ppc64le:
302
+ case llvm::Triple::ArchType::wasm32:
294
303
case llvm::Triple::ArchType::x86:
295
304
case llvm::Triple::ArchType::x86_64:
296
305
addPlatformConditionValue (PlatformConditionKind::Endianness, " little" );
0 commit comments