Use TI.hasBuiltinAtomic() when setting ATOMIC_*_LOCK_FREE values. NFCI
I noticed that the values for __{CLANG,GCC}_ATOMIC_POINTER_LOCK_FREE were incorrectly set to 1 instead of two in downstream CHERI targets because pointers are handled specially there. While fixing this downstream, I noticed that the existing code could be refactored to use TargetInfo::hasBuiltinAtomic instead of repeating the almost identical logic. In theory there could be a difference here since hasBuiltinAtomic() also returns true for types less than 1 char in size, but since InitializePredefinedMacros() never passes such a value this change should not introduce any functional changes. Reviewed By: rprichard, efriedma Differential Revision: https://reviews.llvm.org/D135142
Loading
Please sign in to comment