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 origin/main HEAD --extensions c,cpp,h -- 
clang/test/Driver/fmatrix-memory-layout.c 
clang/test/Sema/matrix-col-major-builtin-disable.c 
clang/include/clang/Basic/LangOptions.h clang/lib/Driver/ToolChains/Clang.cpp 
clang/lib/Frontend/CompilerInvocation.cpp clang/lib/Sema/SemaChecking.cpp 
clang/unittests/Frontend/CompilerInvocationTest.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index 066ff8b1c..e1590ba0a 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -5710,7 +5710,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction 
&JA,
         CmdArgs.push_back(Args.MakeArgString("-fmatrix-memory-layout=" + Val));
         CmdArgs.push_back("-mllvm");
         CmdArgs.push_back(Args.MakeArgString("-matrix-default-layout=" + Val));
-        
+
       } else {
         D.Diag(diag::err_drv_invalid_value) << A->getAsString(Args) << Val;
       }
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp 
b/clang/lib/Frontend/CompilerInvocation.cpp
index 198bf3c0a..d39759186 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -4562,11 +4562,13 @@ bool CompilerInvocation::ParseLangArgs(LangOptions 
&Opts, ArgList &Args,
       else
         Opts.setDefaultMatrixMemoryLayout(
             LangOptions::MatrixMemoryLayout::MatrixColMajor);
-      
+
       for (Arg *A : Args.filtered(options::OPT_mllvm)) {
         StringRef OptValue = A->getValue();
-        if (OptValue.consume_front("-matrix-default-layout=") && ClangValue != 
OptValue)
-            Diags.Report(diag::err_conflicting_matrix_layout_flags) << 
ClangValue << OptValue;
+        if (OptValue.consume_front("-matrix-default-layout=") &&
+            ClangValue != OptValue)
+          Diags.Report(diag::err_conflicting_matrix_layout_flags)
+              << ClangValue << OptValue;
       }
     }
   }
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 047b4c07b..45f3b7f21 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -16344,9 +16344,10 @@ ExprResult Sema::BuiltinMatrixColumnMajorLoad(CallExpr 
*TheCall,
     return ExprError();
   }
 
-  if(getLangOpts().getDefaultMatrixMemoryLayout() != 
LangOptions::MatrixColMajor) {
-      Diag(TheCall->getBeginLoc(), 
diag::err_builtin_matrix_major_order_disabled)
-      << /*column*/1 << /*load*/ 0;
+  if (getLangOpts().getDefaultMatrixMemoryLayout() !=
+      LangOptions::MatrixColMajor) {
+    Diag(TheCall->getBeginLoc(), diag::err_builtin_matrix_major_order_disabled)
+        << /*column*/ 1 << /*load*/ 0;
     return ExprError();
   }
 
@@ -16466,13 +16467,14 @@ ExprResult 
Sema::BuiltinMatrixColumnMajorStore(CallExpr *TheCall,
     Diag(TheCall->getBeginLoc(), diag::err_builtin_matrix_disabled);
     return ExprError();
   }
-  
-  if(getLangOpts().getDefaultMatrixMemoryLayout() != 
LangOptions::MatrixColMajor) {
-      Diag(TheCall->getBeginLoc(), 
diag::err_builtin_matrix_major_order_disabled)
-      << /*column*/1 << /*store*/ 1;
+
+  if (getLangOpts().getDefaultMatrixMemoryLayout() !=
+      LangOptions::MatrixColMajor) {
+    Diag(TheCall->getBeginLoc(), diag::err_builtin_matrix_major_order_disabled)
+        << /*column*/ 1 << /*store*/ 1;
     return ExprError();
   }
-  
+
   if (checkArgCount(TheCall, 3))
     return ExprError();
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/167628
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to