[clang-tools-extra] [llvm] [clang] [clang] Refactor Builtins.def to be a tablegen file (PR #68324)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 18 05:45:14 PST 2024


================
@@ -6571,11 +6571,14 @@ class AtomicExpr : public Expr {
   /// \return empty atomic scope model if the atomic op code does not have
   ///   scope operand.
   static std::unique_ptr<AtomicScopeModel> getScopeModel(AtomicOp Op) {
-    if (Op >= AO__opencl_atomic_load && Op <= AO__opencl_atomic_fetch_max)
+    // FIXME: Allow grouping of builtins to be able to only check >= and <=
+    if (Op >= AO__opencl_atomic_compare_exchange_strong &&
+        Op <= AO__opencl_atomic_store && Op != AO__opencl_atomic_init)
----------------
AaronBallman wrote:

I think it's fine for the moment, the FIXME comment clarifies what needs to be done to improve it in the future.

I would also be fine if you wanted to tackle it now (perhaps we should have some marking in the .td file to say "these should be grouped together as a range"?).

https://github.com/llvm/llvm-project/pull/68324


More information about the cfe-commits mailing list