================
@@ -874,12 +874,12 @@ static void InitializePredefinedMacros(const TargetInfo
&TI,
Builder.defineMacro("__ATOMIC_SEQ_CST", "5");
// Define macros for the clang atomic scopes.
- Builder.defineMacro("__MEMORY_SCOPE_SYSTEM", "0");
- Builder.defineMacro("__MEMORY_SCOPE_DEVICE", "1");
- Builder.defineMacro("__MEMORY_SCOPE_WRKGRP", "2");
- Builder.defineMacro("__MEMORY_SCOPE_WVFRNT", "3");
- Builder.defineMacro("__MEMORY_SCOPE_SINGLE", "4");
- Builder.defineMacro("__MEMORY_SCOPE_CLUSTR", "5");
+ Builder.defineMacro("__MEMORY_SCOPE_SYSTEM", "__memory_scope_system");
----------------
ssahasra wrote:
> Should the same be done for the orderings?
Orderings are defined by the C11 and C++11 standards, and everyone else just
follows the same numbering, so there is no issue there.
> Also is there a reason these were implemented with defineMacro, instead of
> requiring you to include a builtin header of some sort?
I think #72280 was merely following the pattern set by the orderings. It could
have been a header, but having it in the preprocessor means that the Clang
scoped extension of the GNU atomics "just works".
https://github.com/llvm/llvm-project/pull/185408
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits