This patch adds the support for atomic compare in parser. The support
in Sema and CodeGen will come soon. For now, it simply eimits an error when it
is encountered.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Note you'll want to add a line to flang/lib/Semantics/check-omp-structure.cpp for the new clause or the flang build will fail.
CHECK_SIMPLE_CLAUSE(Compare, OMPC_compare)
Since we directly emit an error in Sema, I'm not sure if we can do the same thing as clang/test/OpenMP/atomic_ast_print.cpp because we can always get compile error. I'll see what we can do.
I think I'm going to build another patches on top of this one and land them altogether. In this way, I don't need to add any test in this patch.
clang/include/clang/AST/OpenMPClause.h | ||
---|---|---|
2234 | final | |
clang/lib/Sema/SemaOpenMP.cpp | ||
11400–11402 | Maybe emit error in codegen instead? Without adding err_omp_atomic_compare message in include/clang/Basic/DiagnosticSemaKinds.td, just emit emit directly there: unsigned DiagID = CGM.getDiags().getCustomDiagID( DiagnosticsEngine::Error, "atomic compare is not supported for now"); CGM.getDiags().Report(SLoc, DiagID); |
clang/lib/Sema/SemaOpenMP.cpp | ||
---|---|---|
11400–11402 | I think emitting error here sounds better because if we defer it to codegen, it's like it already passed Sema but in fact it didn't. |
final