diff options
author | Ben Shi <ben.shi@streamcomputing.com> | 2022-01-28 10:09:12 +0000 |
---|---|---|
committer | Ben Shi <ben.shi@streamcomputing.com> | 2022-01-30 02:26:19 +0000 |
commit | 653836251ac41775e3d376e9ee28efd2ea0232b2 (patch) | |
tree | 6eaabae1cc5bb68cf5748f41036d6db52f1ecc9b /clang/lib/CodeGen/TargetInfo.cpp | |
parent | ac3894cf1e093baff747d63bd37844b9176bcbe0 (diff) | |
download | llvm-653836251ac41775e3d376e9ee28efd2ea0232b2.zip llvm-653836251ac41775e3d376e9ee28efd2ea0232b2.tar.gz llvm-653836251ac41775e3d376e9ee28efd2ea0232b2.tar.bz2 |
[clang][AVR] Set '-fno-use-cxa-atexit' to default
AVR is baremetal environment, so the avr-libc does not support
'__cxa_atexit()'.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D118445
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index 3b5389ee..8a01502 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -8304,12 +8304,14 @@ public: // Check if global/static variable is defined in address space // 1~6 (__flash, __flash1, __flash2, __flash3, __flash4, __flash5) // but not constant. - LangAS AS = D->getType().getAddressSpace(); - if (isTargetAddressSpace(AS) && 1 <= toTargetAddressSpace(AS) && - toTargetAddressSpace(AS) <= 6 && !D->getType().isConstQualified()) - CGM.getDiags().Report(D->getLocation(), - diag::err_verify_nonconst_addrspace) - << "__flash*"; + if (D) { + LangAS AS = D->getType().getAddressSpace(); + if (isTargetAddressSpace(AS) && 1 <= toTargetAddressSpace(AS) && + toTargetAddressSpace(AS) <= 6 && !D->getType().isConstQualified()) + CGM.getDiags().Report(D->getLocation(), + diag::err_verify_nonconst_addrspace) + << "__flash*"; + } return TargetCodeGenInfo::getGlobalVarAddressSpace(CGM, D); } |