@@ -101,6 +101,7 @@ static const SupportedConditionalValue SupportedConditionalCompilationArches[] =
101
101
" s390x" ,
102
102
" wasm32" ,
103
103
" riscv64" ,
104
+ " avr"
104
105
};
105
106
106
107
static const SupportedConditionalValue SupportedConditionalCompilationEndianness[] = {
@@ -391,6 +392,10 @@ void LangOptions::setHasAtomicBitWidth(llvm::Triple triple) {
391
392
setMaxAtomicBitWidth (128 );
392
393
break ;
393
394
395
+ case llvm::Triple::ArchType::avr:
396
+ setMaxAtomicBitWidth (0 );
397
+ break ;
398
+
394
399
default :
395
400
// Some exotic architectures may not support atomics at all. If that's the
396
401
// case please update the switch with your flavor of arch. Otherwise assume
@@ -541,6 +546,9 @@ std::pair<bool, bool> LangOptions::setTarget(llvm::Triple triple) {
541
546
case llvm::Triple::ArchType::riscv64:
542
547
addPlatformConditionValue (PlatformConditionKind::Arch, " riscv64" );
543
548
break ;
549
+ case llvm::Triple::ArchType::avr:
550
+ addPlatformConditionValue (PlatformConditionKind::Arch, " avr" );
551
+ break ;
544
552
default :
545
553
UnsupportedArch = true ;
546
554
@@ -564,11 +572,11 @@ std::pair<bool, bool> LangOptions::setTarget(llvm::Triple triple) {
564
572
}
565
573
566
574
// Set the "_pointerBitWidth" platform condition.
567
- if (Target.isArch32Bit ()) {
568
- addPlatformConditionValue (PlatformConditionKind::PointerBitWidth, " _32" );
569
- } else if (Target.isArch64Bit ()) {
570
- addPlatformConditionValue (PlatformConditionKind::PointerBitWidth, " _64" );
571
- }
575
+ if (Target.isArch32Bit ()) {
576
+ addPlatformConditionValue (PlatformConditionKind::PointerBitWidth, " _32" );
577
+ } else if (Target.isArch64Bit ()) {
578
+ addPlatformConditionValue (PlatformConditionKind::PointerBitWidth, " _64" );
579
+ }
572
580
573
581
// Set the "runtime" platform condition.
574
582
addPlatformConditionValue (PlatformConditionKind::Runtime,
0 commit comments