[clang] [llvm] [OpenMP]Initial parsing/sema support for target_device selector set (PR #118471)

via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 3 03:29:42 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 6c7b988e64b60cff7e9f3777dfcc2b2511ee48c6 7f64773f0d76b8fd7edf12b3a2dd791b5bd2a9bf --extensions cpp,c,h -- clang/include/clang/Sema/SemaOpenMP.h clang/lib/AST/OpenMPClause.cpp clang/lib/Parse/ParseOpenMP.cpp clang/lib/Sema/SemaOpenMP.cpp clang/test/OpenMP/begin_declare_variant_messages.c clang/test/OpenMP/declare_variant_ast_print.c clang/test/OpenMP/declare_variant_bind_to_decl.cpp clang/test/OpenMP/declare_variant_messages.c clang/test/OpenMP/declare_variant_messages.cpp clang/test/OpenMP/metadirective_messages.cpp clang/test/OpenMP/nvptx_declare_variant_name_mangling.cpp llvm/include/llvm/Frontend/OpenMP/OMPContext.h llvm/lib/Frontend/OpenMP/OMPContext.cpp llvm/unittests/Frontend/OpenMPContextTest.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp
index bb3aa9fc95..870c4224c3 100644
--- a/clang/lib/AST/OpenMPClause.cpp
+++ b/clang/lib/AST/OpenMPClause.cpp
@@ -2903,7 +2903,7 @@ TargetOMPContext::TargetOMPContext(
     const FunctionDecl *CurrentFunctionDecl,
     ArrayRef<llvm::omp::TraitProperty> ConstructTraits)
     : OMPContext(ASTCtx.getLangOpts().OpenMPIsTargetDevice,
-		 ASTCtx.getTargetInfo().getTriple(),
+                 ASTCtx.getTargetInfo().getTriple(),
                  ASTCtx.getLangOpts().OMPTargetTriples.empty()
                      ? llvm::Triple()
                      : ASTCtx.getLangOpts().OMPTargetTriples[0]),
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 48f6fa53fc..6635d5c236 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -15634,7 +15634,7 @@ void SemaOpenMP::ActOnOpenMPDeviceNum(Expr *DeviceNumExpr) {
   Expr::EvalResult EvalResult;
   // Strip implicit casts from the expression
   DeviceNumExpr = DeviceNumExpr->IgnoreImpCasts();
- 
+
   // Evaluate the expression to an integer value
   if (DeviceNumExpr->EvaluateAsInt(EvalResult, SemaRef.Context)) {
     // The device expression must evaluate to a non-negative integer value.

``````````

</details>


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


More information about the cfe-commits mailing list