diff options
author | Nikolas Klauser <nikolasklauser@berlin.de> | 2024-01-24 11:22:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-24 11:22:43 +0100 |
commit | 4a582845597e97d245e8ffdc14281f922b835e56 (patch) | |
tree | 628fe154c820b70385de1d5c358d2aece817c265 /clang/lib/Sema/SemaChecking.cpp | |
parent | cd7ea4ea657ea41b42fcbd0e6b33faa46608d18e (diff) | |
download | llvm-4a582845597e97d245e8ffdc14281f922b835e56.zip llvm-4a582845597e97d245e8ffdc14281f922b835e56.tar.gz llvm-4a582845597e97d245e8ffdc14281f922b835e56.tar.bz2 |
[clang] Refactor Builtins.def to be a tablegen file (#68324)
This makes the builtins list quite a bit more verbose, but IMO this is a
huge win in terms of readability.
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 7833d5a..4d280f2 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -2471,7 +2471,7 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID, #define ATOMIC_BUILTIN(ID, TYPE, ATTRS) \ case Builtin::BI##ID: \ return SemaAtomicOpsOverloaded(TheCallResult, AtomicExpr::AO##ID); -#include "clang/Basic/Builtins.def" +#include "clang/Basic/Builtins.inc" case Builtin::BI__annotation: if (SemaBuiltinMSVCAnnotation(*this, TheCall)) return ExprError(); @@ -7869,18 +7869,18 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange, static_assert(sizeof(NumArgs)/sizeof(NumArgs[0]) == NumForm && sizeof(NumVals)/sizeof(NumVals[0]) == NumForm, "need to update code for modified forms"); - static_assert(AtomicExpr::AO__c11_atomic_init == 0 && - AtomicExpr::AO__c11_atomic_fetch_min + 1 == - AtomicExpr::AO__atomic_load, + static_assert(AtomicExpr::AO__atomic_add_fetch == 0 && + AtomicExpr::AO__atomic_xor_fetch + 1 == + AtomicExpr::AO__c11_atomic_compare_exchange_strong, "need to update code for modified C11 atomics"); - bool IsOpenCL = Op >= AtomicExpr::AO__opencl_atomic_init && - Op <= AtomicExpr::AO__opencl_atomic_fetch_max; - bool IsHIP = Op >= AtomicExpr::AO__hip_atomic_load && - Op <= AtomicExpr::AO__hip_atomic_fetch_max; - bool IsScoped = Op >= AtomicExpr::AO__scoped_atomic_load && - Op <= AtomicExpr::AO__scoped_atomic_fetch_max; - bool IsC11 = (Op >= AtomicExpr::AO__c11_atomic_init && - Op <= AtomicExpr::AO__c11_atomic_fetch_min) || + bool IsOpenCL = Op >= AtomicExpr::AO__opencl_atomic_compare_exchange_strong && + Op <= AtomicExpr::AO__opencl_atomic_store; + bool IsHIP = Op >= AtomicExpr::AO__hip_atomic_compare_exchange_strong && + Op <= AtomicExpr::AO__hip_atomic_store; + bool IsScoped = Op >= AtomicExpr::AO__scoped_atomic_add_fetch && + Op <= AtomicExpr::AO__scoped_atomic_xor_fetch; + bool IsC11 = (Op >= AtomicExpr::AO__c11_atomic_compare_exchange_strong && + Op <= AtomicExpr::AO__c11_atomic_store) || IsOpenCL; bool IsN = Op == AtomicExpr::AO__atomic_load_n || Op == AtomicExpr::AO__atomic_store_n || |